LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting text from file to numeric array

Solved!
Go to solution

I have a problem i cant convert text from file to numeric array and i dont know why. I add my vi and txt file.

Download All
0 Kudos
Message 1 of 27
(5,917 Views)

What have you tried?

 

Did i just not see the VI there?  Maybe i need more coffee.  I can't open it anyways.  Smiley Frustrated

aputman
0 Kudos
Message 2 of 27
(5,906 Views)

Read from spreadsheet string will work for you.

Capture.PNG

 

aputman
0 Kudos
Message 3 of 27
(5,881 Views)

I can't open it either, but on my platform I had to remove all the commas first.

 

Read Text.png

0 Kudos
Message 4 of 27
(5,878 Views)

Crisdragon / aputman,

 

I assumed the comma was the thousands separator, not the delimiter.

0 Kudos
Message 5 of 27
(5,871 Views)

Are the commas delimiters or thousand separators?

aputman
0 Kudos
Message 6 of 27
(5,868 Views)

There is a right-click option for the Read Text File to read lines.  Enable that and set the number of lines to read to be -1 (read all lines).  This will give you an array of your data points.  Then just use the Fract/Exp String To Number to get your data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 27
(5,859 Views)

Thank you for the Read Lines tip Crossrulz 🙂 On my machine I still have to remove all the commas to get it to convert to number correctly.

0 Kudos
Message 8 of 27
(5,852 Views)

@Gregory wrote:

Thank you for the Read Lines tip Crossrulz 🙂 On my machine I still have to remove all the commas to get it to convert to number correctly.


As do I.

aputman
0 Kudos
Message 9 of 27
(5,846 Views)

@aputman wrote:

@Gregory wrote:

Thank you for the Read Lines tip Crossrulz 🙂 On my machine I still have to remove all the commas to get it to convert to number correctly.


As do I.


Same for me.  That is due to localization.  Some places use the comma as a decimal place.  Glancing at the data, I just assumed the OP was in one of those locals.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 27
(5,836 Views)