I've searched the web for ways to ignore data in specific colums of a text file. I found a way or two but they didn't seem to make much sense to me. So my question is, what would be the best way to ignore data from specific colums in a text file?
Printable View
I've searched the web for ways to ignore data in specific colums of a text file. I found a way or two but they didn't seem to make much sense to me. So my question is, what would be the best way to ignore data from specific colums in a text file?
What's wrong with reading line by line and then parsing out what you want?
the "right" solution for this depends very much on what your data looks like in the first place. For example, scanf() can be used with the "*" option, e.g "%*d" will "skip" a number in the input. But your data may not be numbers, and it may not be in a format that is easily understood using scanf(). MacGyver's solution is definitely an option.
--
Mats
I guess the easiest way to do this was using the ignore after reading what I wanted to keep from the file. I tried it this way and it worked.