LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import spreadsheet file with multiple columns

Hello...

I am trying to import an Spreadshhet file that is space delimited. When I import the file with MS Excel (using space delimiter) everything works well. The file has 34 columns with 257 rows each, but when I try to import the same file with Labview using Read Spreadsheet (space delimited), the VI import only one column of 257 rows. The wire is connected to ALL ROWS terminal of the read spreadsheet function and goes to an index array. I leaved the Highlight Execution ON and after I selected the file to read, what goes from the Read Spreadsheet function was 257X1, and not 257X34 that is the correct result.

Attached is the VI and the data ASCII file

Thanks in advance

Daniel


Download All
0 Kudos
Message 1 of 5
(4,284 Views)
Hello,

I think your problem is that when you specify the space delimeter your constant is normal display, right click the constant and select "'\' Codes Display", you will see that your constant is \\s instead of \s, fix this and run it.  Since your file is space delimited and you have spaces in your text file you are going to have lots of columns of zeros, just a heads up.

Cheers


Message Edited by jmcbee on 05-27-2008 04:17 PM
0 Kudos
Message 2 of 5
(4,277 Views)
Hello jmcbee....

You are right... I changed the code and now everything is working....

Despite the columns generated with zeros, its really a bug of my ASCII file, but I can get around of this using DELETE FROM ARRAY function, because all the files that I import have the same pattern. I can specify the columns that will be deleted.

Thanks for help, my problem is solved!

Daniel
0 Kudos
Message 3 of 5
(4,270 Views)
The previous post pretty much clears it up but it seems that your delimter is actually two spaces therefore you can use "\s\s" in code display to avoid a lot of arrays of zeros.
Message 4 of 5
(4,267 Views)
Hello martym...

I changed the delimiter to \s\s and now the imported array is exactely what I want. The only problem is that my first column is blank, but is a problem of the source data file. I will use Delete from array to remove only the first column.

Thanks for attention and quick answer.

I wish that someday I can help someone with Labview issues, since that I am only a beginner user.

Thanks all!

Daniel
0 Kudos
Message 5 of 5
(4,260 Views)