LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Logging to a .csv file

Solved!
Go to solution

Hi,

I have attached a file that creates an array of 32 string values. Each value are headings - temp1, temp2, temp3 etc. Then I gave wired the array to a Write Delimited Spreadsheet. I was hoping all 32 values will come in different cells in the spread sheet files, i.e in all in 1st row but different columns. But I  am getting all values in 1 cell, i.e row 1 column 1. How can I make it in separate columns. 

0 Kudos
Message 1 of 10
(5,031 Views)

Hi govind,

 

unfortunately you attached a LV2018 VI which I cannot open right now.

 

But this one works as requested:

check.png

 

How can I make it in separate columns. 

Do you know the meaning of "CSV"? It's like "comma seperated file"…

 

- Do you use the comma as separator character in your VI?

- Does Excel (or whatever you use to open that CSV file) also expect the comma?

- Excel will also tend to use other chars as well, like TABs in txt files or semicolon for CSV files…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(5,018 Views)

Its ok you dont have to open my file, because it is 100% nonsense what I have done. But can u please give me the name of the vi inside the for loop. 

0 Kudos
Message 3 of 10
(5,008 Views)

Hi govind,

 

you know I attached a snippet?

Why don't you look for yourself?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(5,000 Views)

Its format into string. But I am still not getting it in different columns. I use the delimiter as a comma in the write delimited spreadsheet, but then when I run it, all the values are coming in the same cell, but there is a comma at the end of each value. I also used a write to text file and gave the file name as .csv.  In the write to text file, I am getting it in different cells, but then i am getting in different rows and same column, but what i want is same row different columns. Please help me how to correct one of the above or both. 

0 Kudos
Message 5 of 10
(4,994 Views)

Hi govind,

 

I use the delimiter as a comma in the write delimited spreadsheet, but then when I run it, all the values are coming in the same cell, but there is a comma at the end of each value.

Please show a snippet of your VI.

And please explain how you "run" the CSV file (or better: which tool do you use to examine its content?)!

 

Using the right tool will show your CSV file with different values in different columns…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(4,988 Views)
Solution
Accepted by topic author govindsankar

You can fix it with Text to Columns in Excel. Some regions (especially countries using decimal comma) use semicolon as separator instead of comma. 

So, try either using ";" as separator or fix it in Excel afterwards with Text to Columns.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 10
(4,987 Views)

Thank you. I didnt know that. Using semicolon as delimiter worked. That was the problem. Thank You very much.

0 Kudos
Message 8 of 10
(4,982 Views)

Hi govind,

 

Using semicolon as delimiter worked.

Did you read message #2?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(4,978 Views)

@Yamaeda wrote:

You can fix it with Text to Columns in Excel. Some regions (especially countries using decimal comma) use semicolon as separator instead of comma. 

So, try either using ";" as separator or fix it in Excel afterwards with Text to Columns.

/Y


I have found it best to use the tab as the delimiter and then save the file as a .txt.  Excel tends to open it right up with no issues for me.


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 10
(4,974 Views)