08-27-2013 09:59 AM
Hi,
I use several folders, which have several data called .txt at the end. Some of the folder have no .txt datas and some folder have one or two of .txt datas.
I want to write a script which makes it possible for me to search for the .txt datas in the folders and let me know the Name of the data.
At the moment, I have no idea how to search in folders for special data.
Maybe somebody of you know how I could programme this code?
Thank you very much for your help.
Best regards,
Mosquito
08-27-2013 11:21 AM
Hello Mosquito,
There is no Script required to do what you are trying to do based on my understanding of your explanation.
You just need to follow these two steps:
1. Add ALL the directories you wish to search for you *.TXT files to the DataFinder Search Areas, be selecting a grey folder in the NAVIGATOR, right-clicking the folder and then selecting "Add Search Area ...". This will ass the grey folder to the "Search Areas" = Yellow folders on top the the tree view in the "My DataFinder" view of the NAVIGATOR.
2. In the NAVIGATOR panel, find the text box on top of the file system hierarchy view, and type "*.txt" into the <Enter search text> field as shown in the screen shot below. Press the "Search" button to the right of the text field, and you will get a list of all *.txt files that are contained within your yellow search area directories.
That's it. No scripting required ...
Let me know if that helps.
Otmar
08-28-2013 02:50 AM
Hello Otmar,
Thank you very much for your help. 🙂
I wrote a GUI where all product numbers are listed in a list box. For example A01, A02 ... I´m not sure, if I can search with the navigator for the .txt files by clicking on the product numbers listed in a list box in the GUI.
At the end a text field in the GUI should show me the name of the .txt file for the product number which was selected in the list box.
Thank you for your help.
Best regards,
Mosquito
08-28-2013 04:11 AM
Hello Otmar,
I selected the directory where DIAdem should search for *.txt, but in the NAVIGATOR the .txt files does not appear althrough there are some .txt datas in the folder. Do you know, if DIAdem has some special settings to view also .txt files in the NAVIGATOR?
Thank you in advance.
Best regards,
Mosquito
08-28-2013 07:31 AM
Hi Otmar,
Sorry to bother you, but do you know how I could read the File.Folder path, like it is shown in you second picture? The name of my path is for example ... \ ...\A1. So I would like to know the last part of the File.Folder, in this case A1.
In the list box of my GUI I want to click the name A1 and it should show me the File.Name of the text file for example test.txt
Best regards
08-28-2013 06:32 PM
Hi Mosquito,
I'm guessing the problem you have is that you don't have a DataPlugin registered that reads your *.txt data files. Can you load one of those data files into the Data Portal? Can you post some of your *.txt data files for us to look at?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-29-2013 02:34 AM
Dear Brad_Turpin,
Thank you for your answer. I have already load on eof the DataPlugin to read *.txt files. It works now.
I´m trying to solve this problem I mentioned in the message 5, now. I´m not sure if it works that way.
-Mosquito
08-29-2013 11:18 AM
Hi Mosquito,
You can use the Split function, like this:
FolderPath = "C:\D\E\F\G\H" Folders = Split(FolderPath, "\") j = UBound(Folders) MsgBox Folders(j)
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-04-2013 06:44 AM
Thank you very much. It was very helpful! 🙂
Best regards