Reading a string from a file and outputting it into another file.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • liyana
    New Member
    • Feb 2007
    • 1

    Reading a string from a file and outputting it into another file.

    Hi,

    I am new in C++ and i am not sure how to do this.

    I have a file (a.txt) which contains infos like this:

    'abcd123'
    'd12345-01'
    '12345'

    I would like the output in another file (b.txt) to contain only string of certain line, let say:

    abcd123
    12345

    But i am not sure how to actually scan the infos by x-coordinate. i do know that C++ can use getline to read by lines. how about the x-axis?
  • hirak1984
    Contributor
    • Jan 2007
    • 316

    #2
    your problem is not clear.why do you need x axis in reading file contents?
    Originally posted by liyana
    Hi,

    I am new in C++ and i am not sure how to do this.

    I have a file (a.txt) which contains infos like this:

    'abcd123'
    'd12345-01'
    '12345'

    I would like the output in another file (b.txt) to contain only string of certain line, let say:

    abcd123
    12345

    But i am not sure how to actually scan the infos by x-coordinate. i do know that C++ can use getline to read by lines. how about the x-axis?

    Comment

    Working...