Click here to Skip to main content
15,900,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have a *.csv file, contains 7 columns and many lines. First line is header.
I want to read csv file line by line and draw a graph.
I need second and fifth columns to put them into a hash like
fifth column is values and horizontal axis, second column is keys and vertical axis.
How can i do this ?

Thanks in advance

1 solution

Since you are not asking a specific coding-based question, I'm not going to provide a code-based answer, but rather the logic you will need to figure out in code.
1) Locate, validate and open the file.
2) Read the file line by line.
2a) Process each data line putting the values derived from there into appropriate variables.
3) Close the file
4) Apply the data now based in variables to your graphing object/algorithm.
5) Update your display.
6) That's it... You're done and you can go have a nice cold beer for a job well done.

Share this answer
Richard MacCutchan 5-May-11 12:01pm    
Sorry but your solution is flawed, point 2 should be 2a and point 2a should be 2b.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900