From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-01-2011 01:45 AM
Hi, as attached below is a textfile that contains some values. I wish to know how may I retrieve all the values in column 1 and all the values in column 2?
Thanks.
09-01-2011 02:01 AM - edited 09-01-2011 02:08 AM
Hi Fred,
- Do you start counting with 1 or with 0 (zero)? To be more clear: Do you need the "names" of the parameters or just their values? Should the 3rd column be disregarded?
- Can you reformat that text file to use only one single separator between "name" and "value"? Right now you're using a lot of spaces where a single tab would be sufficient...
- Do you also need the date/time values? Can you switch to "standard" without that AM/PM stuff?
Solution steps:
- Read the text as string
- replace all consequutive spaces by single tabs
- use SpreadsheetStringToArray
- use IndexArray to get 1st and 2nd column
Edit:
This thread seems highly related to this one...
09-01-2011 08:18 PM - edited 09-01-2011 08:22 PM
What do you mean by do I start counting with 1 or 0 (zero)? The 3rd column should be disregarded because I intend to retrieve the value from the first two columns and feed it into a polar plot vi and plot an ellipse. Is this possible? The text file that I attached is just an example so the spaces, date and time values with the AM/PM stuff depends on how each user datalog files look like. Actually the reason why I want to retrieve values from the text file is because I need to show an ellipse on my front panel and its synchronize with the graylevel value that is also retrieve from the text file.
This is what I have done so far, but the subarray indicator would return me the value of row 9 in my text file. So can you please tell me what change do I need to make?
09-01-2011 08:32 PM
As for the how do I retrive a particular line from my text file question on the duplicate thread. How do you wire a "13" to the ReadLine function?
09-02-2011 02:08 AM - edited 09-02-2011 02:13 AM
Hi Fred,
I would wire a 13 to the count input:
How would you interpret the context help?
"Actually the reason why I want to retrieve values from the text file is because I need to show an ellipse on my front panel and its synchronize with the graylevel value that is also retrieve from the text file."
That's what I would do: