Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Formatting text based on delimeter

Formatting text based on delimeter

Scheduled Pinned Locked Moved C / C++ / MFC
helphtmltutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gregarion
    wrote on last edited by
    #1

    Hey guys, i am having a problem formatting my text in a file. what i did was to extract some information from a html file and i would like to format it. Currently my information comes out in this way...

    Code: Select all
    Cast (Cast overview, first billed only), Sam Worthington ... Jake Sully ,Zoe Saldana ... Neytiri ,Sigourney Weaver ... Dr. Grace Augustine ,

    what i would like to achieve is for the program to read the "," and then based on then "," paste it to a newline and continue.. for example...

    Code: Select all
    Cast (Cast overview, first billed only)
    Sam Worthington ... Jake Sully ,
    Zoe Saldana ... Neytiri ,
    Sigourney Weaver ... Dr. Grace Augustine

    Anybody can give some clue on how i can format my text according to this way? Hope for some help in this. Thanks!

    G 1 Reply Last reply
    0
    • G gregarion

      Hey guys, i am having a problem formatting my text in a file. what i did was to extract some information from a html file and i would like to format it. Currently my information comes out in this way...

      Code: Select all
      Cast (Cast overview, first billed only), Sam Worthington ... Jake Sully ,Zoe Saldana ... Neytiri ,Sigourney Weaver ... Dr. Grace Augustine ,

      what i would like to achieve is for the program to read the "," and then based on then "," paste it to a newline and continue.. for example...

      Code: Select all
      Cast (Cast overview, first billed only)
      Sam Worthington ... Jake Sully ,
      Zoe Saldana ... Neytiri ,
      Sigourney Weaver ... Dr. Grace Augustine

      Anybody can give some clue on how i can format my text according to this way? Hope for some help in this. Thanks!

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      I think the first step is to handle

      gregarion wrote:

      Cast (Cast overview, first billed only),

      so I'd sugget searching for the bracket ')', adding one more to the character position, then removing that part of the string... then, the rest of what you need can be performed by tokenising (look it up, plenty of info/examples around) on the ',', giving you the sub-strings of cast ... 'g'

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups