ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read multiline excel cel (text)

Hi,

 

I am trying read a excel sheet which has text data and some of them are multi-line cels (entered with ALT+Enter).  How do I read this to a array ... multi-lines cels are seems to be disorganizing the arra...

 

please advise

0 Kudos
Message 1 of 9
(5,278 Views)
Please post what you have did so far, so that it will be easy to help you.
0 Kudos
Message 2 of 9
(5,260 Views)
Read this thread and provide your comments if it helps you.
0 Kudos
Message 3 of 9
(5,256 Views)

Hi mathan, thanks for the reply...

 

here is what I have sofar...(see attached ZIP file).  ZIP contain a VI and a excel file... please select the path to the excel file and run... I have indiacted in the file the format that I like have..

 

please advise if this can be done.

 

thanks

0 Kudos
Message 4 of 9
(5,227 Views)

Hai suresh,

 

How you entered the data in cells B2 and C3?

 

Is there just a space in between [one three] and [134 145]?

 

This works for me. Please explain me if it was right?

Download All
0 Kudos
Message 5 of 9
(5,207 Views)

Hi Mathan,

 

Some cells will have multilines (\n... with the use of ALT+ENTER key stroke).  I belive when I am reading the file the"\n" is creating a problem.  The excel file is created by some other process and I am trying to utlize the file as it is.

 

onother thought...

 

can activex used to find the cell range of a workbook... like what is the range of Col and Row that has data.  If I know the cell rage, then I should be able to read data cell by cell and replace any "\n" with some other char.. then I guess I should be able to write to a table.

 

thanks

 

//Suresh

0 Kudos
Message 6 of 9
(5,191 Views)

First off, you are not reading an Excel file. You are reading a text file. That's a big difference. The inclusion of the linefeed means that you have to parse the file manually. The built-in Read From Spreadsheet File will treat the linefeed as a new row. The attached VI is one way you can do this.

 

You can also read the original Excel file directly, but that requires ActiveX. There are a couple of shipping examples showing you how to use ActiveX with Excel. You can also look over the Excel thread

Message 7 of 9
(5,186 Views)

I actually have a method of reading and writing directly from excel sheets without the activeX.  This includes the 2007 format.

 

Is this really desired?  I have been joking about selling it for the last year to two.

 

 

0 Kudos
Message 8 of 9
(5,058 Views)

So, would you be so kind to provide us the solution?

Pretty please.. 🙂

 

Regards,

Vedran

0 Kudos
Message 9 of 9
(4,946 Views)