03-18-2009 10:22 AM
using LabVIEW 7.1 I want to list and read several files in a certain directory.
I want to recursively search and read these files starting from a root-directory,
however the directory-path at some point contains illegal characters, probably because the data is originating from Japan.
Now the recursive filelisting is not able to look beyond that part of the directory.
Windows displays these chars as 3 square's, and Labview displays them as 3 question marks, and generates a error.
I could ofcourse manually rename the illegal chars, but since intent to analyse lots of these files, doing a manual rename would be too much work.
Does anyone know a solution for this problem ??
Thanks in advance ,
René
03-18-2009 10:39 AM
What is your OS?
Can you create an empty file with one of these names, zip it up, and attach it?
03-19-2009 02:05 AM
Hello Altenbach,
the OS is windows XP (SP3),
problem with zipping is that winzip itself is not able to zip this file (including its full directory):
" the name of a folder that contains files to be added has characters in its name that are not supported by the current code page"
LabVIEW shows the full path as:
C:\XOC39_Data_150\87760543\1\???5\TextSave\Mtfbp_12_SLAno_12.CSV
These 3 ??? signs are shows by windows XP as 3 squares, on a Mac or Vista these chars are shown as Japanse signs.
René
03-19-2009 09:37 AM
Looks like you've got Unicode filenames. LabVIEW 7.1 did not support Unicode, so the File I/O functions won't work correctly with Unicode filenames. Unicode support has slowly been added to LabVIEW. Not sure about the extent of its support in 8.6.
One alternative is to use the Windows API functions directly. I think I remember reading about using strconv, or something like that. Will have to look around. Or, you can google for "open unicode filenames XP". You will likely need to install the language support files for your operating sytem for this to work though.
03-20-2009 02:05 AM
I tried the recursive file-lister of LabVIEW 8.5 (on windows2000) and this gave me the same errors,
not being able to read past these characters.
Now I am trying to locate a "freeware" program to remove these characters recursively from the names,
leaving the rest intact. Couldn't find anything yet ...
René
03-20-2009 03:21 AM
ramekers wrote:I tried the recursive file-lister of LabVIEW 8.5 (on windows2000) and this gave me the same errors,
not being able to read past these characters.
Now I am trying to locate a "freeware" program to remove these characters recursively from the names,
leaving the rest intact. Couldn't find anything yet ...
René
You could experiment with the command line in Windows. Not sure if the command line will support such file names at all but if it goes bad there, then you are indeed in deep trouble. Try to start a command line and do a dir command in such a directory. Then try to do a rename on such a file. It might work.
I doubt there is a GUI application that does specifically do this task, so you may have to resort to a batch file script doing it on the command line if the above experiment shows you that this is possible at all.
Rolf Kalbermatter