in reply to candlestick from csv

Firstly, welcome to the Monastery.

Good effort on trying to use <code></code> tags, but you would have noticed that your post didn't look quite right when you clicked preview, before clicking create. Could you please edit your post and fix it up.

(from what I can see it looks like you've put every line inside a <p> tag, which isn't necesssary. You're meant to use 1 set of <p> tags around an entire paragraph, not each line. And if you've opened a <p> tag you need to close it </p> before opening a <code> tag.)

Your question, "i want to use a csv file which contains 2007/12/28, 36.1000, 36.2300, 35.6700, 36.1200
2007/12/29, 36.1100, 36.2400, 35.6100, 36.1000
etc.
to populate @msft above
help please
"

I'll leave you with a few hints, and leave you to work out the solution.

1. You'll need to open a file handle to your csv file.
2. You'll need to read the file with some kind of loop.
while(my $line = <$fh>){ #block }

3. Then you'll need to push it onto your @msft array.

happy learning, and remember Perldoc is your friend when writing code. Even the saints among us still refer to it.

Replies are listed 'Best First'.
Re^2: candlestick from csv
by Anonymous Monk on May 22, 2015 at 18:09 UTC

    Hope this helps

    my @msft = (); open(F,"FILE_NAME.txt") or die "Cannot open File:$!\n"; while (<F>){ chomp; my $tuple; @$tuple = split(/,/, $_); push (@msft, $tuple); }