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.
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.
08-04-2015 09:57 AM
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?
Solved! Go to Solution.
08-04-2015 10:01 AM
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).
08-04-2015 10:03 AM
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!
08-04-2015 10:17 AM
Yeah, I don't understand why tab would be the default for a write to spreadsheet function, but that worked for me. Thanks.
08-04-2015 10:31 AM
@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.
08-04-2015 10:57 AM
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.
08-04-2015 01:15 PM
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.