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: 

Reading text file to make a list

Hello ,

I want to read a specific column from the text file if the columns are separated by a space.

When the whole file (as shown here http://imageshack.com/a/img834/6321/k55hx.jpg

) is read its column1 names should be visible in a drop list and whenever a name is selected from the list it should select its respective value from column2 in the text file and display the value in indicator.

I tried as shown here(http://imageshack.com/a/img829/6821/x4h0.jpg ) and got the output like this(http://imageshack.com/a/img840/1431/ior7.jpg ) but I am unable to get the required.

Can someone help me out with this.

 

Thanks.

0 Kudos
Message 1 of 8
(2,912 Views)

Hi stefan,

 

when you need columns from your file you should index columns - and not rows!

 

Btw. always attach your images here in the forum directly. Links to 3rd party web sites are considered bad behaviour!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(2,901 Views)

The code you posted is basically correct, but you are selecting the row - not the column. Also we can't see what the string constant is. There are a couple ways to make nonprintable characters visible, or there is a space string constant.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(2,897 Views)

Thanks but can you explain more clearly of how to do this(perhpas with a vi).

 

0 Kudos
Message 4 of 8
(2,871 Views)

wire the column input to the column selector input on the array indexer, not the row selector input.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 8
(2,863 Views)

Hi stefan57.

 

 

If I understand you correctly, you are trying to make a dropdown list with the values from the first coloum, and when the user changes this values, you want the data to be shown.

I have made a small exampled that demostrates how this can be done.

(please note, that this code should be further improved, eg. by implementing proper error handling)

 

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
Download All
0 Kudos
Message 6 of 8
(2,828 Views)

Hi,

I want to try it as well but its in labview13 can somone convert it to labview11.

0 Kudos
Message 7 of 8
(2,808 Views)

Try this.

 

Best Regards

Alex E. Munkhaus
Certified LabVIEW Developer (CLD)
System Engineer
0 Kudos
Message 8 of 8
(2,799 Views)