01-08-2019 02:05 AM
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.
Solved! Go to Solution.
01-08-2019 02:21 AM - edited 01-08-2019 02:24 AM
Hi govind,
unfortunately you attached a LV2018 VI which I cannot open right now.
But this one works as requested:
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…
01-08-2019 03:07 AM
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.
01-08-2019 03:57 AM
01-08-2019 04:33 AM
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.
01-08-2019 04:40 AM
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…
01-08-2019 04:43 AM
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
01-08-2019 04:54 AM
Thank you. I didnt know that. Using semicolon as delimiter worked. That was the problem. Thank You very much.
01-08-2019 05:41 AM
01-08-2019 06:31 AM
@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.