08-04-2021 08:59 AM
Hello
my data is stored in csv file daily in row as i attached file.
i want to read its second last and last row of data.
how can i do that.
need any suggest and guide.
Thanks
asif
08-04-2021 09:03 AM
Read the complete csv-file and select the last two rows within LabVIEW.
Regards, Jens
08-04-2021 09:32 AM
08-04-2021 02:56 PM
You have attached a file in a proprietary xlsx format, nothing resembling CSV. Can you attach the CSV file instead?
How big is the file getting over time? Do you have a reasonable upper limit on the number of characters in a row (=line). From the files size you can guess a reasonable file position that includes the last few lines and parse from there.
08-04-2021 10:40 PM
hi
please see attached csv file, i just want to read yellow highlightened fields, no need to read colum headers and time.
data is saved at 8am and 8pm.
thanks,
asif
08-04-2021 10:51 PM
hi
sorry to say, i actually saving file in xls format, please consider xls file and suggest.
thanks
asif
08-06-2021 01:07 AM
Hi
i just try by modifying example code and have attached here.
now i want how can i set end address of get data as my row and column.
Thanks
asif
08-06-2021 08:02 AM
Hey Asif. What do you mean by setting "end address of get data"? Like getting all data up to a row, column coordinate? Either way, I'd recommend two things.
1: Write data to a more neutral format than .xlsx, like a true delimited text file like a .csv. That way you don't need to use special toolkits to read Excel files or other formats. Everything can read a text file!
2: If you have to use Excel files and the Report Generation Toolkit, read the whole file and then dissect it to get what you want. Remove headers, select rows, select columns, whatever you want to do, but do it to the whole table instead of cutting out data at the read step. I find it's usually easier and if some day you decide you want to use those headers or other rows or columns, you just modify what you do with the data instead of modifying what data you're importing, which might affect the other functions you're already doing on the data, shifting rows or columns and making you have to go revisit your other functions.
I attached some basic table reading operations. Maybe you can get some hints on what you're trying to do there?
08-06-2021 10:34 AM
You can get the position of the last row using "excel get last row" and calculate the start and end positions from there. May need a tweak or two, nothing a +1 or -1 cannot fix. 😄
(And please clean up your code before attaching a snippet. Having overlapping wires flowing in all directions is not helpful)
08-06-2021 01:25 PM
Thanks for your replay
please send me snippit.
asif