LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CSV to XLS

Solved!
Go to solution

Alright folks. 

 

I'd like to use Labview to convert a csv into an xls spreadsheet file.

 

I was thinking labview could open the spreadsheet, search for the commas "," and convert them into a "/t". 

 

is there a search function that does this? 

0 Kudos
Message 1 of 7
(4,321 Views)
Solution
Accepted by topic author Zyshan

An XLS spreadsheet file has a great deal different in it aside from using tab vs comma for the delimiter. An XLS file is a proprietary Microsoft format that needs to be written from Excel. (Which can be done through LabVIEW) If you simply want to convert a comma separated value text file to a tab delimited text file, that is easy, see attached snippet

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
Message 2 of 7
(4,313 Views)

You can do this a bit more simple.

 

teste.png

 

Set Offset if needs

OBS: Swap "," to ";"  if needs

Message 3 of 7
(4,294 Views)

You still have a text file.  Don't give it an .xls extension since it is not a real Excel file.

0 Kudos
Message 4 of 7
(4,291 Views)

Excel will open the CSV without any issues.  You can then save this data in a different format using Excel.  If you want to programmatically create an xls file, you will need to use an ActiveX interface, which can be a major pain but can be done.


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 5 of 7
(4,268 Views)

The easiest way is to just open the CSV file in Excel.  It will figure out that it's commas instead of tabs or at least ask you what the delimiter is.  Then, save it as a real XLS.

 

BTW, if you don't NEED to make it an XLS then don't.  A CSV or TSV file is more versatile (and smaller).  TSV is generally better since it won't get all confused if you end up working with European spreadsheets that have currency.  Remember that they use the comma for their decimal and it can really confuse a CSV formatted spreadsheet.

 

EDIT: Beat me by a minute...  Why do I even try? Smiley Sad

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 6 of 7
(4,267 Views)

Thanks for all the helpful replies guys.

I think I confused the matter by stating the file had to be xls, what I meant was just tab delimited. 

0 Kudos
Message 7 of 7
(4,236 Views)