LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read lines output as string

Good morning,
 
I recently upgraded from 7.1 to 8.5, and found the file palette, ah, took a step to the left from what I'm used to.  Not necessarily worse, just different.
 
I'd like to use the Read Text from File primitive in "Read Lines" mode to read 100 lines at a time.  No problem.  However, I'd like to have it output a string, not an array of strings.
 
Is it possible?
 
(Yes, I know I can tack the array of strings together into a single string.  Why do I have to?  Or did LV always just do this under the hood?)
 
Thanks,
 
Joe Z.
0 Kudos
Message 1 of 5
(2,946 Views)
The Read From Text File function will output an array if you wire in a count that's greater than -1. Unfortunately, that's just the way it works in 8.x. Note that the 7.1 "version" is still available (albeit updated to use 8.2 functions). It's in vi.lib\Utility\file.llb.
0 Kudos
Message 2 of 5
(2,919 Views)
I think you can also find it if you do a search within the Function palette. 
Although I can verify since there's no LV on this PC 😞
0 Kudos
Message 3 of 5
(2,910 Views)

Thanks for the replies.

Looking at the old Read Lines from File.vi... it *is* a bit of a mess, isn't it?

I'll do a bit of cleanup and comparative benchmarking to see which method works better for what I'm doing.

Joe Z.

0 Kudos
Message 4 of 5
(2,899 Views)
For the record: the two methods are almost the same as far as timing in my particular application of creating column indices.
 
I suspect that Read Lines from File.vi has a little more room to optimize, should it be necessary.
 
Thanks all,
 
Joe Z.
0 Kudos
Message 5 of 5
(2,855 Views)