From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to search in a text file and plot

hello,
 
I'm trying to read a .txt file. (phonebook)

Backer, Guido  (36)1134   GBac
Baerts, Peter te  5357 M   PtB
Baeten, Stephan  5552   SBae
Baiardini, Fabio  5043 M   FB
 
Now i want a search function that if i type a number,name,part of name, the program show's the whole line.
 
type: Bae
 
results: Baerts, Peter te  5357 M   PtB
             Baeten, Stephan  5552   SBae
 
I Tried a lot of things but I cant make in work. who can help me?
thanks,
Willem v.d. linden
0 Kudos
Message 1 of 6
(2,451 Views)

Could you please post ur work as of now. then its easy for us to debug and make it work easier.

Thanks,

Mathan

0 Kudos
Message 2 of 6
(2,449 Views)
Hi Willem,
you could create an array from your data. Depending on what you are searching for you can index this column and use the "search array" function (only possible if you insert for example the full name). If you want to search for a part of the name, i think you have to go through a loop. Use the "match pattern" function inside the loop. If you work with a 2d array you can, after you found the specified row, index the 2d array and show your line.
 
Mike
0 Kudos
Message 3 of 6
(2,448 Views)

it won't work!!! aaargh! haha. thanks anyway....  gonna try to write this as a program in notepad..

 

greetz



Message Edited by willem_ on 06-06-2008 03:19 AM
0 Kudos
Message 4 of 6
(2,431 Views)
Hi willem,
here is a first example with which you can start.
 
Mike
Download All
0 Kudos
Message 5 of 6
(2,423 Views)
Thanks mike!!!
0 Kudos
Message 6 of 6
(2,415 Views)