LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xls Öffnen und die letzten 10 Zeilen lesen

Kann ich eine xls Datei öffnen und nur die letzten 10 Zeilen lesen?
Oder kann ich mir Anzeigen lassen, wie viele Zeilen sich in der xls Datei befinden?
Es wäre ziemlich umständlich, wenn ich die ganze Datei laden müsste, da sie immer aus ca 1200-1600 Zeilen besteht.
 
MfG
Thomas
0 Kudos
Message 1 of 3
(2,699 Views)
Hi,


Sorry, no German...


You can open a reference to the file (File I/O>Open) and then read data from any offset. If your data is of a known size (e.g. 10 bytes), you can get the entire file size (File I/O>Advanced>Seek EOF) subtract 10X10 bytes, and then read from that position to the end (File I/O>Read File).


If you don't know the size of the data it's a bit more difficult. Start with an empty string. Read an amount of data (e.g. 50 bytes), and prepend it to the data you have. See if you caught 10 results. If not, repeat until you do.


Hope it helps,


Wiebe.


"thomhofm" <x@no.email> wrote in message news:1151046606947-382600@exchange.ni.com...
Kann ich eine xls Datei öffnen und nur die letzten 10 Zeilen lesen?
Oder kann ich mir Anzeigen lassen, wie viele Zeilen sich in der xls Datei befinden?
Es wäre ziemlich umständlich, wenn ich die ganze Datei laden müsste, da sie immer aus ca 1200-1600 Zeilen besteht.
&nbsp;
MfG
Thomas
0 Kudos
Message 2 of 3
(2,691 Views)

"Wiebe@CARYA" <wiNOebe.walsSPtra@carAMya.nl> wrote in message news:449c0f9c@PYROS.natinst.com...
Hi,


Sorry, no German...


You can open a reference to the file (File I/O>Open) and then read data from any offset. If your data is of a known size (e.g. 10 bytes), you can get the entire file size (File I/O>Advanced>Seek EOF) subtract 10X10 bytes, and then read from that position to the end (File I/O>Read File).


If you don't know the size of the data it's a bit more difficult. Start with an empty string. Read an amount of data (e.g. 50 bytes), and prepend it to the data you have. See if you caught 10 results. If not, repeat until you do.


Hope it helps,


Wiebe.



This only works if the xls file is an ASCII or binary file, not if it's an excel file...



"thomhofm" <x@no.email> wrote in message news:1151046606947-382600@exchange.ni.com...
Kann ich eine xls Datei öffnen und nur die letzten 10 Zeilen lesen?
Oder kann ich mir Anzeigen lassen, wie viele Zeilen sich in der xls Datei befinden?
Es wäre ziemlich umständlich, wenn ich die ganze Datei laden müsste, da sie immer aus ca 1200-1600 Zeilen besteht.
&nbsp;
MfG
Thomas
0 Kudos
Message 3 of 3
(2,691 Views)