Hello all,

I wondering if anyone could tell me how to go about extracting a single field from a text file.

The file is all follows:

Jeff 8.00 8.9900 hadk
Kim 234.0 234 hak
Him 444.8 1.11 john...

How would I extract only the first column without using tokenizer or split?

Thank you,

9 Years
Discussion Span
Last Post by ~s.o.s~

I have never heard of serialization but I will read the tuturial and give it a try. In the mean time, would parsing a text file work? If so, how would I go about achieving the desired results?



If you can't use split I doubt regex would be considered a viable alternative. It more or less does the same thing behind the scenes.

Maybe you should just google what other options you can use from the string class, such and find() and substring()?


> Serialilzation is solution to your question.
Serialization is a completely different beast. In serialization, you serialize i.e. persist an object onto the secondary storage and read them again as and when required. Here the user is presented with a simple text file so the only option is to read the file using the File streams or readers and parsing the content as required.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.