LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to search for data in txt file

Hey Everyone,

I am trying to create a vi that will take my txt look-up table and find a specfied pathloss from it. I was using an xml format but the continues writing process to the file was lagging pretty bad. So I have decided to make a switch to txt. The one thing I liked about xml is the I could assign a header and search for that string and import the pathloss and frequency into an array and use it in my teststand code. Can txt do about the same? I have looked through the tools on labview and I have found huge sections on xml alone. If I leave it in an xml format and write it to an xml file can I still search for the header and pull the right data? Attached is my vi that I will be using to create the txt file, the vi that I used to parse through the xml file, and a sample txt file (so you can get an idea on where my mind set is Smiley LOL).

 

Thanks,

dlovell

0 Kudos
Message 1 of 9
(3,346 Views)

can you upload it in LV2011 version.??

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 9
(3,344 Views)

Hey Nghtcrwlr,

Here are the vis in 2011.

 

Thanks,

dlovell

0 Kudos
Message 3 of 9
(3,315 Views)

Hi dlovell
I dont understand you question clearly. Are you now trying to read the attached text file and search for something? What does the array name stand for? I see nothing to match the array name in the attached text file.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 9
(3,295 Views)

Hey Nghtcrwlr,

Yes that is correct. I am doing a search on the contents in the txt using the header name. I sent the wrong txt file that is suppose to work with the Find Array_TestStand.vi program. Attached is part of the entire look-up table. You can see that the header the program is suppose to search for looks like this: "<Name>RF Switch Matrix I1 to O1 50000000</Name>". The problem I am having is using the "Find Array_TestStand.vi" to do txt instead of xml.

 

Thanks,

dlovell

0 Kudos
Message 5 of 9
(3,278 Views)

Hello dlovell

 

Well, there is no direct VIs available to convert XML to text, tht i am aware of. Otherwise you will have to program it yourself.

 

Another option is to search for what you need like searching the Array name then using search/split string search waht you need and son on. But i guess then u will extract the dimension first and then repeat it for the specified number of time...That is really a tedious task.

 

May be some other LV experts can give you some other tips.

 

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 9
(3,245 Views)

What do you mean by "The problem I am having is using the "Find Array_TestStand.vi" to do txt instead of xml."

XML is text, so what do you expect ?

Can you give an example of the output you are seeking ?

Maybe some kind of small database is what you are looking for. But you need to give some more information on what you are using the data for and what format you are expecting it in.

0 Kudos
Message 7 of 9
(3,209 Views)

Hey dkfire,

Thanks for responding. I am aware that xml is just a form of txt the problem I am having is the search vi isn't working on txt files. If you look at the data after each header you will see two values, a frequency and a pathloss. I would like to store these values into an array and then use them in any of my teststand sequences. I was hoping to keep the xml format because I like how they are structured with the headers. Is there anyway to take the existing vi and have it search through the txt file and extract the desired data without having to completely tear apart the vi. I am no where close to being that adept with labview. Hope this helps to understand my problem.

 

Thanks,

dlovell

0 Kudos
Message 8 of 9
(3,194 Views)

Right now you get an two dimensional array out with two values. What is it you are missing ?

Do you want all the values from all the names ?

0 Kudos
Message 9 of 9
(3,178 Views)