LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

csv data for excel getting concatenated to one column

Solved!
Go to solution

Ok, so I just ran the VI contained in the screen shot I showed you, and everything works just fine.  The 2D data is properly appended to the file.  It's written as 2D data.  I can transpose it or not...I did both.  I stuck everything in a WHILE loop and again, it behaved perfectly.

 

I've attached the VI I scribbled up -- it's really simple -- run it a few times and convince yourself.  (You'll need to put some numbers in the 1D array control that I put in there for data.)

 

If you want to attach your code instead of just a screen shot, I might be able to help further.

 

 

0 Kudos
Message 11 of 19
(1,420 Views)

I doubt it's the DAQ card data -- that doesn't make sense.  Something else is going on, perhaps the way you're acquiring the data but not the data itself.  I replaced the 1D array control in my little test VI with a simulated output from a DAQ board and it made no difference (which is what I would expect).  The functions still work properly.  I was still able to append the 2D data from the simulated DAQ to a file.

 

Please post your code so I can look at it.

0 Kudos
Message 12 of 19
(1,416 Views)

i uploaded the mainvi mouse loader here

there are two sub vis included.
http://www.engr.uconn.edu/~jmacione/temp/labview86/

 

there are two examples of the csv file in teh directory

 one where i wire in the iteration counter and one from the daq device

the one from the daq device has a period between where the two columns should be, and all the data is in one column.

Message Edited by jimmyinct3 on 11-02-2009 06:42 PM
0 Kudos
Message 13 of 19
(1,413 Views)
Please post your code on this forum and not using a 3rd-party URL.
0 Kudos
Message 14 of 19
(1,407 Views)

the example you posted earlier does not seem to work right.

the basics of it do appear correct though. 

 

i have to make specific test cases to post on the NI userforum which take time.

even with a string, it still dosent work, appending all the data in one column.

im starting to think a subvi got corrupt somehow.

 

 

 

Download All
0 Kudos
Message 15 of 19
(1,393 Views)
The test programs are working perfectly fine and nothing is corrupt. What you have to remember is that you are not creating an csv file because you are using the wrong delimiter. The default is a tab. Change it to a comma and you will have a comma separated variable (csv) file.
0 Kudos
Message 16 of 19
(1,390 Views)

if a comma is used as the delimeter, the 2nd column to appear in excel becomes a string

The first column is still numerical.

 I can switch the numerical inputs so they appear in the other columns, the 2nd is always a string

 

This is something ive done like a thousand times before.

Ive never had to specify a delimeter in the "write to CSV" vi.

 

 

0 Kudos
Message 17 of 19
(1,384 Views)
Solution
Accepted by jimmyinct3

jimmyinct3 wrote:

 

....

This is something ive done like a thousand times before.

Ive never had to specify a delimeter in the "write to CSV" vi.

 

 


Then you've never been able to open the file by double clicking it. A CSV file is self-explanatory. No comma - no csv.

 

There is still nothing wrong with the code. It is creating a perfectly fine text file with data separate with tabs (if you don't wire anything up) or commas. Look at the file with notepad. If Excel is not opening it correctly, you've got a problem with Excel.

Message 18 of 19
(1,380 Views)

ok, i got it working now.

there was a space in with the comma with that making one of the values convert to text.

 

Ive really never had to use a delimeter before.

Tab or comma, it has always opened up in excel without problems

 

anyway, kudos given..

 

0 Kudos
Message 19 of 19
(1,365 Views)