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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the number from a certain column in an running .CSV file

Solved!
Go to solution

Hi GerdW,

 

The last method for building string array I found that very helpful.

 

I have tried different cases for decimal correction, it didn't work. can you please tell me, how can I solve this problem?

 

Unbenannt.PNG

0 Kudos
Message 41 of 80
(1,003 Views)

Hi Shannara,

 

did you read the LabVIEW help on format codes by now?

%,2f is just WRONG!

 

Which decimal separator is your OS set to? Do you use the comma as decimal separator?

Which decimal separator is Excel (on your specific computer) expecting?

Does Excel also expect the tab used as delimiter in your CSV files?

 

Can you attach the text files you created?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 42 of 80
(1,001 Views)

In LabVIEW, the delimited separator is set to the localized decimal point and Excel also it is according to Germany which is set to comma as decimal separator. 

 

"%,;" this formats the local delimited separator, right?

0 Kudos
Message 43 of 80
(998 Views)

Hi Shannara,

 


@Shannara wrote:

In LabVIEW, the delimited separator is set to the localized decimal point and Excel also it is according to Germany which is set to comma as decimal separator. 


Then go with a comma in the numeric data and the tab as delimiter in your text files.

Be warned: whenever you will get in contact with international customers/collaborators you will get into trouble with such TSV files very quickly. I recommend to use the point as decimal separator…

 


@Shannara wrote:

"%,;" this formats the local delimited separator, right?


Yes, %,; sets the comma as decimal separator when converting numbers into strings (or vice versa).

But still %,2f is plain wrong…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 44 of 80
(994 Views)

Is it right?Unbenannt.PNG

0 Kudos
Message 45 of 80
(991 Views)

Hi Shannara,

 

still not right.

%,; just specifies to use the comma as decimal separator, but there is no information on how to format the floating point number!

 

Use %,;%.3f - and read the LabVIEW help on formatting codes again!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 46 of 80
(996 Views)

HI GerdW,

 

Sorry for disturbing you, I still didn't get the solution for it. I have got the values like this.Unbenannt.PNGUnbenannt.PNG

0 Kudos
Message 47 of 80
(993 Views)

Is it possible, the timestamp can be converted into array format?

0 Kudos
Message 48 of 80
(984 Views)

Hi Shannara,

 

how often have I told you by now that %,2f (or %,3f) is plain wrong for a format code!?

Again: read the LabVIEW help on format codes!

 

Try this even more simple code:

(When the numbers already are converted to strings then it doesn't make sense to use a numeric format code for WriteDelimitedFile…)

 


@Shannara wrote:

Is it possible, the timestamp can be converted into array format?


Why do you need this?

And how should the array look like?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 49 of 80
(973 Views)

I mean, not in the string array format, I mean it should be like a Unbenannt.PNGnumerical array format.

 

In this code format, it is saving the data as I need, the problem is with the timestamp, How can I convert time stamp in the numerical array format?

Unbenannt.PNG

0 Kudos
Message 50 of 80
(967 Views)