LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting one long columnar dataset into different columns

 I am trying to do some data manipulation using labview.

Our CFD program gives us profiles that are one continuous column of x, y, z and various datapoints.  Typically, we open it in notepad and find the variables and copy the data below it and paste it on an excel spreadsheet, but I'm trying to come up with a labview program that will do it for me. I also wanted to be able to "batch process" files given a certain folder.

I've attached the VI that I have come up with. Its in the midst of an iteration, but  reads various files and writes them out to seperate files, but I'm having difficulty writing columns of x, y, and z in adjacent columns. I tried building an array, but there seems to be some error in data type compatibility.

I've also attached a sample of the data file that I would like to process.

Any help would be greatly appreciated.

Thanks,

Janak

NB: The test data file actually doesn't contain any extension. I had to give it an .txt extention to post. Please remove the extension when trying to use the file.
Download All
0 Kudos
Message 1 of 5
(2,509 Views)
I am assuming this is a mistake.  You intend to have a 1D array of DBL's coming out of the spreadhseet string to array functions.  You wire the data type you wish not a string containing "1D Dbl".  Create a constant which is an empty 1D array of DBL and wire it into the terminal you have the string now.
0 Kudos
Message 2 of 5
(2,505 Views)
Hi Mathew,

Thanks for all your help. I trying to learn the labview way, so excuse my silly mistakes.

So, now, I've created a constant and built it into an array and connected it the terminal, but I'm not getting the results I want.

The system now is just giving me three zeros.

What am I doing wrong?

I really appreciate your help! I've attached what I've modified.


~Janak
0 Kudos
Message 3 of 5
(2,501 Views)
You have a few problems.  I attached a fixed VI, which addresses the problems.  There is some cleanup that should be done, but I will leave that to you.

When you convert a string to an array, you cannot have any strings in the beginning.  You still had "y" and "z" attached to the top of the strings, so you will get 0's for that string value.  I changed your split string to a match pattern which gives the string after without the matching string attached to it.  I also added the line feed which is on each line.

You also have a problem in your conversion from string to array.  Your lines are seperated by line feeds, not carriage returns.  This is why you only got the first number (which in your case was "y" which becomes 0).  So I changed that.

Lastly, you need to transpose the data when you save it so it is in rows, not columns.

You may have problems loading this into Excel, as you have more than 65536 rows of data.  I don't know about the newest versions of Excel, but some older versions cannot import more than 65536 rows of data.
0 Kudos
Message 4 of 5
(2,493 Views)
Thanks Matthew!! I think I'll be able to work on this to get to where I want!!

Appreciate all your help. Have a wonderful weekend.
0 Kudos
Message 5 of 5
(2,489 Views)