12-02-2010 03:46 PM
12-02-2010 04:29 PM
12-02-2010 07:32 PM
Hi Arvinth,
For whatever reason, NI has depricated the read lines from file VI. It should be located in C:\Program Files\National Instruments\LabVIEW8.61\vi.lib\utility\file.llb
12-03-2010 02:40 AM
Thankyou all for the reply.
As the text file size may vary we have to make the initialization dynamic and the array size(no. of lines) may vary from file to file.
I will work on the solutions suggested and get back.
What is the maximum size of text data that a string can handle ?
12-03-2010 08:10 AM
This function was deprecated because it is no longer needed. Read lines is an option on the Read Text File primitive (albeit somewhat hidden - right click to primitive to find it).
12-03-2010 08:27 AM
The help file for the "Read from Text File" function says:
If you wire –1 to count and the size of the file you want to read is too large to be represented by a 32-bit integer, LabVIEW returns an error.
So the maximum number of character or lines (if you right click the function and check read lines) is I32 max value = 2147483647.
If your files are bigger than that you should modify your acquisition code to generate smaller files.
Ben64
12-06-2010 07:35 AM
As I mentioned earlier, you can also modify your code to change the text so it works in chunks instead of all at once. This will allow you to work with files of any size. However, if you have a file that big, I would urge you to convert it to some form of binary, if you can. Text files over a few hundred kilobytes get very unwieldy and difficult to manage.
12-06-2010 08:00 AM
@DFGray wrote:
This function was deprecated because it is no longer needed. Read lines is an option on the Read Text File primitive (albeit somewhat hidden - right click to primitive to find it).
How do you tell Read Text File WHICH lines to read?
12-06-2010 08:31 AM
The primitive will read from the current position. If you wish to read the fourth line, you need to call it four times with a count of one, or once with a count of four and toss the other lines. I would only recommend this particular mode if you are not parsing a file line by line from the beginning and speed is not an issue. It is far more efficient to read chunks of the file and search for lines in the string chunk itself in most circumstances.
Attached is a VI with a small seek at the beginning to demonstrate the behavior.
12-06-2010 10:43 AM
File position is set in bytes. If you read a chunk of say 60 lines, how do you know how many bytes in to start your read for your second chunk? That is what I like about read lines from file. It gives you the byte count as an output.