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: 

How can I delimit my array to display in excel csv properly?

Solved!
Go to solution

I currently have an array with 6 elements of type dbl inputs. I am trying to use the Write to Spreadsheet function to output this array to a csv file. Since it appears that the array has no spaces when output to the Write to Spreadsheet function, the output for each row looks as follows:

 

0.000.2310.2410.3310.5420.334

 

I need this to output into separate columns in the csv files like this:

 

0.00     0.231     0.241     0.331     0.542     0.334

 

What am I doing wrong?

0 Kudos
Message 1 of 7
(3,021 Views)
Solution
Accepted by topic author RWalker

Since you are writing to a CSV, Excel expects a comma to be the delimiter.  So make sure your delimiter is a comma (the default is a tab).


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 2 of 7
(3,012 Views)

Write to Spreadsheet file.VI has input Delimiter. Just connect there needed delimiter (space, tab, comma), and in the file data will be separated with proper delimiter.

Hopefully, it'll help you!

0 Kudos
Message 3 of 7
(3,008 Views)

Yeah, I don't understand why tab would be the default for a write to spreadsheet function, but that worked for me. Thanks.

0 Kudos
Message 4 of 7
(2,994 Views)

@crossrulz wrote:

Since you are writing to a CSV, Excel expects a comma to be the delimiter.  So make sure your delimiter is a comma (the default is a tab).


I've found that Excel doesn't quickly recognize CSV files (comma separated values) when commas are the separator even though that is the definition and in the name of the file type.  That often when you get a CSV file into Excel, you need to go through the dialog boxes and check off that the comma is a separator.

 

If you use tab in the files, Excel separates values on that with out any extra steps.

0 Kudos
Message 5 of 7
(2,965 Views)

RavensFan wrote:

If you use tab in the files, Excel separates values on that with out any extra steps.


In my experience, that only works if you use a TXT extension.  CSVs have always directly loaded for me in Excel without that dialog.


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 6 of 7
(2,958 Views)

You are probably right.

 

I never save a file with an actual .CSV extension.  If it is readable to me, I call it .txt.

 

I don't understand why Excel doesn't have an option to also have the comma be recognized as a delimter.  It has always annoyed me that I need to go through the dialogs to click that box, or use Text To columns to break up that data.

0 Kudos
Message 7 of 7
(2,916 Views)