cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when working with Write to SpreadSheet

Highlighted
Nathacarrasco
Member

Problem when working with Write to SpreadSheet

Message contains a hyperlink

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.

 

13 REPLIES 13
James.M
Active Participant

Re: Problem when working with Write to SpreadSheet

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>   ---'


Bob_Schor
Knight of NI

Re: Problem when working with Write to SpreadSheet

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

Nathacarrasco
Member

Re: Problem when working with Write to SpreadSheet

Message contains an attachment

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.

James.M
Active Participant

Re: Problem when working with Write to SpreadSheet

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>   ---'


James.M
Active Participant

Re: Problem when working with Write to SpreadSheet

Message contains an image

I edited to actually use the delimiter inputs here instead of writing single comma delimited strings. Take a look:

datafile.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Nathacarrasco
Member

Re: Problem when working with Write to SpreadSheet

Message contains an image

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.

 

ni.jpg

Nathacarrasco
Member

Re: Problem when working with Write to SpreadSheet

I also tried with your modification but it's the same. I suppose it's an Excel issue.

James.M
Active Participant

Re: Problem when working with Write to SpreadSheet

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>   ---'


jetfan67
Member

Re: Problem when working with Write to SpreadSheet

Message contains an attachment

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.

Einstein proved by taking time in thinking about a problem he proved there is no such thing as gravitational pull. Therefore, given enough time and thought a problem can be solved. If the problem is not solved then there has not been enough thought.