LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

device constants search

Hi everyone,
I am currently running into this problem.
I wants wondering if anyone can help me out.
I am working with a Data graphing program.
user select the file to graph.
For instant, SN 10001.csv
that file is located in folder \Data
before we are able to graph it, we have to select the device constants for that file.
in a big file called
file.csv
the device constants for serial 10001 is there, along with SN 10002, SN 10003, SN 10004, etc.
the program is already doing that right now.
but instead of searching in 1 big file called file.csv
I want to search inside a folder of files consisting of devSN1001.csv, devSN1002.csv, devSN1003.csv etc.

so basically,
when I select SN 10001
the program will search inside the folder for devSN1001.csv out of all the other files?
can it be done?




Best regards,
Krispiekream
0 Kudos
Message 1 of 17
(3,765 Views)
so instead of searching 1 file for device constants, i want to search at multiple files
when i search for 1 file. i know the exact string for the search.
but with multiple files. i can't list all the files because they are different everytime.

Best regards,
Krispiekream
0 Kudos
Message 2 of 17
(3,750 Views)
If you know the name of the file, which is based on the entered serial number, why do you have to search for it in the folder? Are you simply trying to verify if it exists? If so, there's a built-in VI to do that. It's File I/O->Adv File Functions->Check if File or Folder Exists. The other approach is to use the List Folder function (same palette), and simply search the array using the Search 1D Array function. You will probably want to convert all the strings to lowercase to eliminate case-sensitivity.
0 Kudos
Message 3 of 17
(3,736 Views)
yeah...i am using the List function.
But once I list it. there are 9 elements in the folder.
for instant

DeviceSN1001_10_31_2007.csv
DeviceSN1002_10_31_2007.csv
DeviceSN1003_10_31_2007.csv
DeviceSN1004_10_31_2007.csv

when I want to graph only SN_1001
I have to search within the folder for something like 1001 and I don't know how to search for it in string.?

Best regards,
Krispiekream
0 Kudos
Message 4 of 17
(3,733 Views)
i dont know how to search within the array
i am new to labview. sorry.
Best regards,
Krispiekream
0 Kudos
Message 5 of 17
(3,731 Views)
Just use the "pattern" input of the "List Folder" function. As the help says:

pattern restricts the files and directories returned to those whose names match pattern. The pattern matching in this function is similar to the matching used in matching wildcards in Windows and Linux file names and is not like the regular expression matching performed by the Match Pattern and Match Regular Expression functions. If you specify characters other than the question mark character (?) or the asterisk character (*), the function displays only files or directories that contain those characters. You can use the question mark character (?) to match any single character. You can use the asterisk character (*) to match any sequence of one or more characters.

Thus, if you wire in a value of *SN1001*.* you will get a listing of all filenames that have SN1001 in them.



If you're brand new to LabVIEW and haven't already done so you should go through the LabVIEW tutorial that ships with LabVIEW. You can also go to the NI Developer Zone Learning Center where you can find more learning resources. You should also consider taking one of the LabVIEW training courses.

Message Edited by smercurio_fc on 11-02-2007 09:01 AM

Message 6 of 17
(3,717 Views)
I have these vi(s).
but i don't know how to narrow down my search?
what can i type in the Regex to match box so that I can search the array better.

Currently, I am typing out the whole string in order to find 1.
I like to narrow it down to "434631" or something. Ignoring what is before it, and what if after it.

Also, instead of typing into the Regex to match, can someone show me how to use the dropdown list to search?
Thanks

Message Edited by krispiekream on 11-02-2007 10:51 AM

Best regards,
Krispiekream
Download All
0 Kudos
Message 7 of 17
(3,704 Views)
to narrow my search,
i used mercurio_fc sugguestion to do
*434631*.* and that did the trick for the Regex to match type in box

But how would I use the dropdown list instead of me typing it in?

Best regards,
Krispiekream
0 Kudos
Message 8 of 17
(3,697 Views)
I fail to see why you think this method is easier than the one I showed you to simply list the files based on a pattern given that you're now calling a subVI and looping.

Whatever.

You seem to be using a System Combobox so all you need to do is to read the control. That returns the text displayed.
0 Kudos
Message 9 of 17
(3,695 Views)
i can't use the one you have because I am using Labview 7.0 and that function is only on 8.0 or greater?
7.0 doesn't have
the "pattern" input of the "List Folder" function.

is that right?

Message Edited by krispiekream on 11-02-2007 11:43 AM

Best regards,
Krispiekream
0 Kudos
Message 10 of 17
(3,690 Views)