LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Csv file generation

Solved!
Go to solution

Hi,

When I am using the 'array to spreadsheet string' function, I am getting an indesired space between the lines ( see picture named error 2 )

Does anyone know how I can avoid this?

It is really annoying me.

Thanks for your help,

Regards,

F

Download All
0 Kudos
Message 1 of 4
(3,512 Views)

You are inserting empty strings into your array.  Those will become lines in the spreadsheet.  The solution is to simply get rid of the empty strings where you build the array of strings.

Nevermind.  Those are inserting cells between your elements.


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 4
(3,483 Views)

What to say?  You have some problems with that code and, providing details.

 

I do not want to start a OT subject but, in the future, just post a Snippet rather than a screenshot!  Menu>>Edit>>Create VI snippet from selection (Better yet get the "Code Capture Tool" from LAVA using VIPM- it has more capabillaties)

 

To the case at hand: "*.csv" is a "comma seperated vector" file.  These files can be imported to Microsoft Excel Spreadseets or, opened in other programs that read text.  Here is where all of my real confussion comes out about this question!  

 

You are placing "Null"s between your string array elements.  Each of the string constants shown in your pngs (get rid of that stacked sequence structure) All of those constants have a ":" Colon at the end.  Then you use a ";" Semi-colon as the delimiter in the array to spreadsheet file functions shown.  Colons and Semi-Colons are each considered "Seperators" that Microsoft Excel uses to interperate how to display text depending on options you select in the Microsoft Excel inport file wizard.

 

Bluntly: Microsoft Excel will import a file with a "csv" extention using default seperator rules.  Your string formatting meets Microsoft Excel's rules for import as displayed.  From the png of the Microsoft Excel spreadsheet- you should be looking into "Write to TDMS file.vi".  We can chat about that more later.

 

EDIT OT: Nice strikeouts Not for the OP


"Should be" isn't "Is" -Jay
Message 3 of 4
(3,478 Views)
Solution
Accepted by feriel0209

feriel0209 a écrit :

Hi,

When I am using the 'array to spreadsheet string' function, I am getting an indesired space between the lines ( see picture named error 2 )

Does anyone know how I can avoid this?

It is really annoying me.

Thanks for your help,

Regards,

F


Array To Spreadsheet String.vi add a carriage return (platform dependant) charater at the end of the string. Use Trim Whitespace.vi (from the String palette) at the output of Array To Spreadsheet String.vi to remove it.

 

Ben64

Message 4 of 4
(3,457 Views)