-1

I have to extract information from a text file. In the text file there is a list of strings. This is an example of a string: AAA101;2015-01-01 00:00:00;0.784 The value after the last ; is a non integer value, which changes from line to line, so every line has different lenght of characters.

I want to map all of these lines into a structured vector as I can access to a specific line anytime I need without scan the whole file again.

I did some research and I found some threads about a command called, which permit me to reach a specific line of a text file but I read it only works if any line has the same characters lenght of the others.

I was thinking about converting all the lines in the file in a proper format in order to be able to map that file as I want but I hope there is a better and quick way

2
  • 4
    It's not clear what your are asking.
    – Anon Mail
    Commented Dec 5, 2015 at 19:14
  • append extra zeros at the end of the last field "value" . Be care full about the excpetions. Commented Dec 5, 2015 at 19:20

1 Answer 1

0

You can try TStringList*. It creates a list of AnsiStrings. Then each AnsiString can be accessed via ->operator [](numberOfTheLine).

Not the answer you're looking for? Browse other questions tagged or ask your own question.