By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

read specific lines in a .csv file particularly the last line

P: 2
I'm looking to read the last line in a .csv file for calculation purposes. I need to get two values from the last line of a .csv file so I can use these values to calculate other values in the program. Or if this is to difficult, the whole point of this is to be able to have a “calibration file” which will story the setting for a machine which will be calibrated occasionally and after each calibration the calibration file will be updated and then the most recent values will be read into the program and used for calculation purposes.

Thank You
Nov 17 '06 #1
Share this Question
Share on Google+
3 Replies


100+
P: 267
I'm looking to read the last line in a .csv file for calculation purposes. I need to get two values from the last line of a .csv file so I can use these values to calculate other values in the program. Or if this is to difficult, the whole point of this is to be able to have a “calibration file” which will story the setting for a machine which will be calibrated occasionally and after each calibration the calibration file will be updated and then the most recent values will be read into the program and used for calculation purposes.

Thank You
hi

do you need a file for this ?

if you run your program on the same machine you may use
something like
SaveSetting "Program","Properties","Setting1",strSetting1

get the value back by

strSetting1=Getsetting ("Program","Properties","Setting1,"")

otherwise


Open FileName For Input As #1
While Not EOF(1)
Line Input #1, p
LastLine = p
Wend
Close #1


LastLine contains the data from the last line in the file
Nov 17 '06 #2

P: 2
hi

do you need a file for this ?

if you run your program on the same machine you may use
something like
SaveSetting "Program","Properties","Setting1",strSetting1

get the value back by

strSetting1=Getsetting ("Program","Properties","Setting1,"")

otherwise


Open FileName For Input As #1
While Not EOF(1)
Line Input #1, p
LastLine = p
Wend
Close #1


LastLine contains the data from the last line in the file

Thank you for your response

while waitng i actually realized that the data was in the variable name.
Nov 17 '06 #3

100+
P: 267
Thank you for your response

while waitng i actually realized that the data was in the variable name.
hi

if you know this name, suppose that's a filename
you can make a commondialog control or a textbox to enter this filename.
Nov 17 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.