LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I would like to read a ASC11 file ?

I would like to read a ASC11 file ? i would like to read the ASC11 file but there is a 2 lines header in this file.and i dont wanna read this header.this ASC11
file has 12 columns and then i wanna convert them to
binary file.
any example would be great.
thanks
0 Kudos
Message 1 of 14
(3,792 Views)
I'm not trying to be rude, but this is maybe the third time you've asked this question. Have you looked at the Write to Text File and Read from Text file examples that shipped with LabView?
To skip the header, just call the Read File function twice before you start reading the data in a loop.
If you get an answer here that doesn't help, please explain why it doesn't help rather than just asking the question again.
0 Kudos
Message 2 of 14
(3,792 Views)
i am sorry that you are getting upset due to my repetitions of question.
well i have looked into example read from text file
and tried with this but it did not solve my problem.
in this example this function is reading data line
by line and i dont want to read the data line by line.
for this reason i removed the inner while loop.
to skip the 2 lines header when i call read file
function 2 times. i still get the header in my result file.
when i write the data of 12 columns and N number of rows by calling write to binary function,i tried to read this binary data with the help of Matlab. i get
only one column and it look likes that it is transposed.the output of the read function is 2 dimensional array. i try to write this 2 dimensional
array by call
ing write to binary function and i also
want to display the 2-Dimensional data in 2 dimensional
indicator array.
this all things i tried already but could not get the
desired result. therefore i wrote again.
any way if you are upset then take my questions back and thanks for your tips.
0 Kudos
Message 3 of 14
(3,792 Views)
Hi Fais,

waht about reading the hole file, and cut the two header lines by string
functions. For example searching for two times, if these
characters mark the end of a header line.

Niko
0 Kudos
Message 4 of 14
(3,792 Views)
Thanks for providing the additional detail. I wasn't upset, just puzzled. LabView's examples sounded to me to be very similar to your application. It is helpful to everyone trying to answer your question if you provide details about why a previous response didn't help.
I've got more questions than answers.
You said "i dont want to read the data line by line". How is the source data formatted? It's very common to have data organized in a table (rows and columns) with each line in a data file representing one row in the table.
You said "to skip the 2 lines header when i call read file function 2 times. i still get the header in my result file". What are you doing with data output from those two reads? If you want to skip the header, don't do an
ything with it. You can leave the output unwired if you really want to skip it.
You said that the data in Matlab "it look likes that it is transposed". If you need to transpose the data, LabView's Array palette has a Transpose 2D Array function.
0 Kudos
Message 5 of 14
(3,792 Views)
When you call Read File to skip the header lines, do you have the Line Mode input set True (as in the Read from Text File example)? Have you looked at the data output of those two reads to verify that the header is being read by them?
0 Kudos
Message 6 of 14
(3,792 Views)
OK i made it, but another approach, may be you can look it. i am attaching the source file. another
question if i have two different source files how
can i merge them?i am trying to use build array function.but after building array how can i write
them to binary file.
0 Kudos
Message 7 of 14
(3,792 Views)
You didn't include the two sub-VIs (Extract NumberSGL.vi and 030211manipulatedwritebinary.vi), so we can't look at much of your program. If you want to "merge" two 1D arrays into a 1D array, you can use Build Array, but you have to change its behavior to Concatenate Inputs: right-click on Build Array and select Concatenate Inputs. By default (without Concatenate Inputs selected), using Build Array on two 1D arrays will give you a 2D array. If your 030211manipulatedwritebinary.vi could write a 1D array, you can still use it if you Concatenate Inputs.
0 Kudos
Message 8 of 14
(3,792 Views)
i am now sending other 2 required VIS.
ok thanks .
Download All
0 Kudos
Message 9 of 14
(3,792 Views)
moreover when i am merging two ASC 11 files.i would like to get the first row of first matrix with first
row of 2nd matrix cncatanated. but now in my existing application, it is concatinating first row of first
matrix with 2nd row of first matrix and so on.when
first matrix is finished it is concatinating last
row of first matrix with first row of 2nd matrix.
this is that i dont want. any suggestions would be appreciated.
thanks
0 Kudos
Message 10 of 14
(3,792 Views)