05-04-2015 08:09 AM
Hi,
Is anyone know how to read specific numbres from a txt file.
If the operator choose tab1. The values displayed will the first list of numbers. If not the values displayed on the table are the second list
Thank you in advance for your help
Please find enclosed my VI and the txt file
My best regards
Nadia
Solved! Go to Solution.
05-04-2015 08:54 AM
Do you require the format that your example tab.txt file is in?
If not, I would consider using a format such as LabVIEW's Config File VI's or a common standard such as XML.
If you do require the exact format in the example, then you may have to write your own parser for it.
05-04-2015 09:07 AM
Thank you for your reply,
I don't require this format. But at the same time I don't see how can I extract my values using the formats you suggested
Could you possibly give me an example
Thank you in advance
My best regards
Nadia
05-04-2015 09:17 AM
Do you have control over the format of the text file? If so I would change it format to make it easy to read in.
If you do not have control over the text file, your best bet is to read in the whole text file and then parse the [tab1] and [tab2].
The "Read From Spreadsheet File.vi" takes to inputs. One is the "number of ROWS (all:1).
The other is "start of read offset (CHARS.:0)"
One is ROW the other is CHARS. Very hard to make that work for you.
05-04-2015 09:49 AM
@k.nadia wrote:
Thank you for your reply,
I don't require this format. But at the same time I don't see how can I extract my values using the formats you suggested
Could you possibly give me an example
Thank you in advance
My best regards
Nadia
For example, using the Config File VI's, you could have each of your "tab1", "tab2", ... be a key under a common section. The data type could be a binary string (the Config File VI's do not support arrays natively, so you would flatten your array to a binary string for storage).
Get Key Names.vi could get you a list of all of your options. The user selects one from the list, then you use Read Key.vi on that key and unflatten the result to your array.
05-11-2015 04:02 AM
Thank you for your answer
I tried it and it works fine
My best regards
Nadia