LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Text file and place in Excel spreadsheet

I have a text file that i need to open and somehow turn it into an array that the write to spreadsheet function can use.  Please any help would be appreciated.  The text file has commas that separate the data that i need placed in cells in excel.
Thanks
0 Kudos
Message 1 of 9
(3,867 Views)
Hiii, Magic

               Can you please send me the file which you want to convert, then i can help you some way, one thing you can do is just do the Read from text file, if you have the LabVIEW 8 and then convert it into array and then write it through the spreadsheet.

Thanks,
Nishant
0 Kudos
Message 2 of 9
(3,858 Views)

Magic,

Just wanted to clarify something:  The Write to Spreadsheet VI in LabVIEW (under File I/O pallette) creates a delimited file that can be opened by many Spreadsheet programs.  It will NOT write directly into an Excel sheet, nor create a native XLS file.  For that, you need magic - just kidding!  Smiley Very Happy  You will need VIs that interface with Excel.  There's a Report Generation Toolkit for Office from NI which does this, and also some free VIs floating on the forum and elsewhere. 

As for the reading, since it's a text file, you can indeed use the Read from Spreadhseet VI to get the data as an array into LabVIEW. 

Regards,

-Khalid

0 Kudos
Message 3 of 9
(3,854 Views)
Hiii, Khalid

       But as he suggest that he already has the tab delimited files in the text file, then why should he worry about the LabVIEW Report generation toolkit? he simply read the file either through Read from spreadsheet or from Read from text and converting it into the array, it will be the simple, cos he already have the tab delimited file, and he again will convert it into the tab delimited file with the Excel file.

Thanks,
Nishant
0 Kudos
Message 4 of 9
(3,849 Views)

Nishant,

I think the ultimate goal is to see this data in Excel cells.  Maybe I misunderstood the question...?

-Khalid

0 Kudos
Message 5 of 9
(3,834 Views)

Hiii, Khalid

                   Actually yes, i also think that his ultimate goal is to see the data in the excel sheet, and thats why i have suggested him this method, but as a senior i would like to know from you that the method i suggested is right? or their should be any changes in that method?

          And finally let him clarify what he wants? Smiley Very HappySmiley Very Happy hahaha.....

Thanks,

Nishant

0 Kudos
Message 6 of 9
(3,828 Views)
Hey guys, these are all good points, but it would seem that the easiest way to get this comma separated text file into Excel would be to open it in Excel. Smiley Wink

Chris
0 Kudos
Message 7 of 9
(3,799 Views)

Chris,

That's actually a very good point... or is it a comma?  Smiley Very Happy

-Khalid

PS:  I assumed the user wanted to open the text file in LabVIEW first, do some processing on it, and then display the results in Excel.  I could be wrong. 

0 Kudos
Message 8 of 9
(3,793 Views)
Hiii, Khalid
 
            We are debating on this topic, but original author has gone out of this post, then why we are debating for this?Smiley Very HappySmiley Very Happy
 
         Let us say file has already been written in the excel and problem is solved.Smiley WinkSmiley Wink
 
Thanks,
Nishant
0 Kudos
Message 9 of 9
(3,789 Views)