From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to i read multiple text files one bye one

Solved!
Go to solution

moderator1983 wrote:

Read lines from text file_Code


Set the count of that File Read to -1 to read all of the lines.  Then you don't need the Open File, While Loop, or the Close File.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 18
(1,644 Views)

If u need read several files at the same time... Follow that:

 

Message 12 of 18
(1,633 Views)

but i need to select multiple file in a single directory tab ... i want to select one by one

0 Kudos
Message 13 of 18
(1,612 Views)

I don't know, where are you stuck... in the replies to this thread, people have suggested you the different ways that you can use to complete your code... moreover people have given you code snippets that you can directly use...!!
I'm wondering, where exactly you're stuck. Can you share what you did so far...??

 

Well you may try writing a small peice of code (prototype) just to read multiple files and then can think of merging it to your main code...!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 14 of 18
(1,609 Views)

untitled.JPG

0 Kudos
Message 15 of 18
(1,587 Views)

i can read the multiple text files.. but only first line of the file get reading.. rest were not reading.. this s the problem

 

 

pls.. help me

 

0 Kudos
Message 16 of 18
(1,586 Views)

The code you are showing on the picture is not good and makes no sense. SInce you only have a 1D array of files, all you need is a single loop. Your inner FOR loop makes no sense, especially since it repeats the same operation N times on the same file, where N is the number of files. SInce you close the file at the end of each iteration, but don't open it again, reading will fail except once. Typically you would use "build array" to concatenate arrays. What is the point of the case structure, it always executes the same case.

 

Instead of showing pictures, attach your actual VI so we ca better see what you are doing. I think it could be simplified dramatically while fixing your problems at the same time. You already got several pretty good suggestions above, so I am not sure why you are posting such meaningless code.

0 Kudos
Message 17 of 18
(1,573 Views)
0 Kudos
Message 18 of 18
(1,443 Views)