06-22-2015 10:20 AM
Hi again. I'm trying to export some adquired data (double) to Excel, I've found this tutorial in NI webpage: https://decibel.ni.com/content/docs/DOC-36448 and it worked but I have a problem: Columns are not separated when I run it. It would be much appreciated if you can help me, I think maybe its some Excel issue but I want to confirm it, thanks.
06-22-2015 10:29 AM - edited 06-22-2015 10:30 AM
It's probably a delimiter issue between columns. The rows are seperated by return/line feeds, so that's easy.
The columns are seperated by whatever you want, default is "\t" (tab). This is an input in to that Write to Spreadsheet VI, so wire whatever you want in there.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-22-2015 10:32 AM
You have not shown your code, so it is difficult to test it or to point out where your error lies. The first question ask is "How do you know the data are not separated?" This is not a silly question -- my guess (and, without seeing your code to confirm this, is only a guess) is you left the default Tab character as the separator, then opened the resulting file (which is really a Text file, not a Spreadsheet) with something that ignored the Tabs. Am I close?
Bob Schor
06-22-2015 10:39 AM
The code is attached (is the same of the link I posted above). I tried adding \t delimiter to get separated columns in Excel but it didn't work.
06-22-2015 10:44 AM
I ran that code you attached and it worked fine.
Did you change anything from that VI? A different file path, or something?
The filepath is for a".csv" file, which is a comma delimited spreadsheet that excel understands is comma delimited. It looks like that VI doesn't use the input "\t" delimiter, they manually did just a single column of strings where the individual strings had commas manually inserted. Ideally, you would use the 2D input to the Write to Spreadsheet VI and use the delimiter input instead of what they're doing.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-22-2015 10:48 AM - edited 06-22-2015 10:59 AM
I edited to actually use the delimiter inputs here instead of writing single comma delimited strings. Take a look:
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-22-2015 10:48 AM
I haven't change a thing of that VI. I run it in LV2014, and when I open the .csv file I get that columns are not separated.
06-22-2015 10:54 AM
I also tried with your modification but it's the same. I suppose it's an Excel issue.
06-22-2015 10:56 AM - edited 06-22-2015 10:58 AM
The only thing I could think is that Excel doesn't see it as a comma delimited file. Does the file extension show up as ".csv"?
Edit: I mean, just in file explorer, how does windows recognize the file? I would suggest also looking at Excel's associated file types that Windows has set as well.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-22-2015 11:02 AM
I wrote an array of real value unsing the same vi "write to a spreed sheet file". the data is place in a row but you can trans[pose the data within Excel.