|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
could you guys help me on this, I need to read the csv file and passing all the value within my csv file into array. my csv file have only two simple columns shown below: AUD 0.72 JPY 200.3 EUR 0.22 USD 0.30 and I try to use this method to read the csv file ... begin assign(myfile,'currency.csv'); reset(myfile); my_outline := TStringList.Create; while not eof(myfile) do begin readln(myfile, line); my_outline.DelimitedText := line; ..... then I dont know how to pass all the value to array.. please help kind regards |
|
#2
|
||||
|
||||
|
my_Outline.Text will give you the complete text of the string list. If you want it as multiple lines, then you can use the my_Outline.Strings property something like this:
Code:
var
i : integer;
s : string;
begin
for i := 0 to my_Outline.Count - 1 do
begin
s := my_Outline.Strings[i];
s := my_Outline[i]; // Same as previous line
end;
end;
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > reading csv file & passing to array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|