LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create new folders according to the value of the 23th byte in data file?

Hi,
I want to classify many data files to some new folders according to the value of the 23th byte in a data file.the value is between 01 to 08,which the new folder name will be.How can I create new folders and how I operate the data files in labview6.0?
0 Kudos
Message 1 of 4
(2,636 Views)
Here's a little image of what you could do to get the data and create the folder.

Parent directory MUST EXIST otherwise your folder won't be created and an error will occur.

Hope this helps !
Julien
0 Kudos
Message 2 of 4
(2,636 Views)
If I'm not missing something, your diagram will try and create a folder whose name is a single character, equal to the value of the 23rd byte in the data file. Since 1 through 8 aren't printable ASCII characters, I guess this might not work, and I assume the poster actually wants the folders to be named "01", "02" etc.

If this is the case, you will want to insert some code between the Read File and Build Path functions to convert the single-character string into the folder name. I'd suggest String to Byte Array, then an Index Array to get the first element (or you could use Array to Cluster with size set to 1, then Unbundle), then Format into String with '%02d' as the format string.
0 Kudos
Message 3 of 4
(2,636 Views)
My example does work, I've tested it.
Anyway, this was just an example of how to read a given number of bytes somewhere in a file.

If the poster want to add a "0" in front of the number I would prefer "catenate" (I don't know if that's the correct expression) the number (string in fact) to a string "0".

Thanks anyway tmh
Julien
0 Kudos
Message 4 of 4
(2,636 Views)