LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple file path open

I have some code that will open the files I want inside a folder, do some appending to a spreadsheet file and close down. I am trying to expand it to open every file inside a set of subfolders within a main folder. I have it pretty close, as you can see by the attached image, but the last bit eludes me. Any ideas on what I am missing?

Tay

Message Edited by slipstick on 07-03-2007 09:27 PM

0 Kudos
Message 1 of 13
(3,307 Views)
There is no reason to have a build array function inside the for loop. When you exit the loop, you have a 2D array that you then index out the first row. Just wire the path out the for loop. This will create a 1D array. Wire this to another for loop where you have the rest of the code.
0 Kudos
Message 2 of 13
(3,292 Views)
I'm not sure why you have the array builder inside the loop or the indexer outside the loop, but if you move the second List Directory function inside the loop you will get all the files in all the subdirectories, one subdirectory at a time.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 13
(3,292 Views)

Mike,

We seem to be answering the same questions at about the same time. Smiley Very Happy 

0 Kudos
Message 4 of 13
(3,285 Views)
Hey I have it working! Almost.

It compiles the data I want, but generates the error I have shown. I suspect it is a loop count mismatch or some such thing. I am not sure how to trap for this. I had the list functions trapping and it wasn't coming out of any of them, and I'm not educated enough as yet to add error trapping for other parts of the code that don't automatically provide for trapping.

By the way, I had to do the 'for' loops this way because if I did it any other way, wires would break and I became hopelessly ensared trying to make them match.

Tay
0 Kudos
Message 5 of 13
(3,268 Views)
1. what do you want to do?
0 Kudos
Message 6 of 13
(3,258 Views)
First of all take out the array builder and the indexer and wire straight from the output of the first Build Path function to the path input to the second List Directory function. They aren't doing anything.

Second, I can't comment on the error because nothing looks like it is set up incorrectly - but I can't be sure exactly where the wires are connected on the List Directory functions. It would be very helpful if you could post your code for us to look at. It is very hard to troubleshoot code from pictures.

Mike...



Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 13
(3,258 Views)
0 Kudos
Message 8 of 13
(3,253 Views)
Ok, here's the code. I have included the two spreadsheet vi's as they are a bit customized. Also a couple of files to play with.

And thanks in advance for the help!

Tay
Download All
0 Kudos
Message 9 of 13
(3,243 Views)
Attached is your code cleaned up. At least this looks like what you were trying to accomplish (all the seleced files appended onto one larger file...

The reason that you were getting the error is that you were telling the read VI to read 4 rows starting after the 132nd character. The only trouble is - the file only had 130 bytes in it, hence the error. My suspicion is that if the file had more than 132 chracters but less than 4 rows, you'd get another error.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 13
(3,231 Views)