Hi I'm looking to read in a large CSV file one line at a time so I can pull out certain columns. For example, one row might be:
AAA,111,BBB,222,CCC,333
...and I want to pull the third column to get a string of "BBB" the put it in an array called SourceID. The post at
https://forum.lazarus.freepascal.org/index.php?topic=42696.0 was a huge help, but the example at the bottom is single characters, and when I apply it I am only getting single characters too.
readln(SourceFile, InputLine);
NumberSourceRows := NumberSourceRows +1;
SourceStringList.delimiter := char(','); //delimiter used
SourceStringList.text := InputLine; //fill text
SourceStringList.DelimitedText := SourceStringList.Text;
SourceID[NumberSourceRows] := SourceStringList.DelimitedText[3];
This gets me the third character which would be A, not the third delimited string. I want the third delimited string.
Any help is appreciated!