04-22-2016 04:41 AM
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
Solved! Go to Solution.
04-22-2016 05:23 AM - edited 04-22-2016 05:24 AM
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.
04-22-2016 05:33 AM - edited 04-22-2016 05:36 AM
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
04-22-2016 06:10 AM
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