LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read all LVM file in a folder and compile

Solved!
Go to solution

Hi 

 

I want to read all the LVM file in a folder as shown in picture 1. In each LVM file there is a row of data that is important as shown in picture 2. I want to extract that row of value in all the LVM files of that particular folder.

 

Then i want to compile it into 1 Excel file or text file.

 

Furthermore, i also want to name each row of values in the newly compile file. The name will be the name of the file it previously extract from , together with the date and time it was created.

 

I tried to use loop and List Folder but to no avail. 

 

Hope it wont be too much a trouble. Thank you

 

 

1.png
2.png
0 Kudos
Message 1 of 9
(4,481 Views)
Solution
Accepted by topic author pengxin

Hi pengxin,

 

 

Which part are you stuck at?

 

Below is a simple block diagram I've created that should do what you need. First we get all the individual file names, then one-by-one we read the data from the file. Since you only need the first row's data, we'll index the array, then append the file name, date and time the file was last modified to the front of the data, then save them into a new file.

untitled.JPG

Hope this helps.

 

Regards,

Boon Chen

Message 2 of 9
(4,445 Views)

Hi

Sorry for the late reply , just got back from my bangkok trip. Could you send me your VI ? It will be a great help. I would test it and post you more information if i need more help. Thank you

 

Cheers 

PX

0 Kudos
Message 3 of 9
(4,410 Views)

Hi Boon Cheng

 

What is the function on the right of Read from Measurement File ? I could not find it .

 

 

 

Cheers 

 

PX

0 Kudos
Message 4 of 9
(4,393 Views)

Hi PengXin,

 

Sorry for my late reply as I was travelling.

 

The function is called Convert from Dynamic Data, it can be found under the Express palette >> Signal Manipulation. It is used to determine the type of output in the data file. If I didn't remember wrongly, it should be either rows are data, or columns are data.

 

I didn't save the example I created so I'm unable to send it to you.

 

Let me know if you need further help in understanding the logic behind the block diagram.

 

Regards,
Boon Chen

0 Kudos
Message 5 of 9
(4,382 Views)

Hi Boon Cheng

 

1) It the next VI i am asking , it looks like array subset. So i want to confirm it with you.

 

2) Now i am facing the problem in List Folder, it keep giving me an error as shown below  1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cheers 

PX

0 Kudos
Message 6 of 9
(4,379 Views)

Hi Pengxin,

 

It's the Index Array function. Idea behind it is to take out the first row of data as you indicated from your file.

 

I'm not sure why you are getting error 13. It should not happen, try putting in the *.lvm extension and see if it helps?

 

Otherwise, let me know the version of LabVIEW you are using so I can check if there's any bug.

 

Regards,
Boon Chen

0 Kudos
Message 7 of 9
(4,372 Views)

Hi

 

 I have manage to solve the problem. I have replaced some of the VI. Thank you and it worked perfectly well

 

Cheer

PX

0 Kudos
Message 8 of 9
(4,361 Views)
I changed the "Read from text file" to "Write to tex file "
0 Kudos
Message 9 of 9
(4,358 Views)