LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

READ TXT FILE IN STEPS

Solved!
Go to solution

Hello Friends,

 

In the past, you've helped me a lot! Smiley Happy


Please, I'm trying to read the variables in attached txt file. The variables appear between the lines 5187 to 5236 (49 lines). Below the line 5241 to 5290 (49 lines). After the same variables of the line 8293 to line 8342 (49 lines) and line 8347 to line 8396 (49 lines). Among the variables there is a spacing of 3106 lines. And so on!

 

The Knight of NI helped me a lot to solve part of the problem. His tips were very helpful!

 

I would like some advice to unify the variables from txt file in just a graphic. Is that possible?

 

Could you modify the vi.vi attached?

 

Thanks

Download All
0 Kudos
Message 1 of 18
(3,168 Views)

@Prof. Arne Saknussemm wrote:

... 

I would like some advice to unify the variables from txt file in just a graphic. Is that possible?

 

...


Can you explain this a bit more?

 

What do you want to graph?  Do you want each set as a separate series or do you want to concatenate and represent as a single time series? 

 

0 Kudos
Message 2 of 18
(3,159 Views)

Taki1999 wrote:

 

Can you explain this a bit more?

 

What do you want to graph?  Do you want each set as a separate series or do you want to concatenate and represent as a single time series?

 


Dear Friend Taki1999 Smiley Happy,

 

I'd like to concatenate and represent as a single time series in a single graph (steps = reading of 98 s at 98 s to 1000 s according to the txt file).

 

Example:

 

time (x-axis) x  tempf 100010000 (y-axis) - tempf 100020000 (y-xis) - tempf 100030000 (y-xis) - tempf 100040000 (y-xis) - tempf 100050000 (y-xis) - tempf 100060000 (y-xis) - tempf 120010000 (y-xis) - tempf 120020000 (y-xis) - tempf 120030000 (y-xis) -  tempf 120040000 (y-xis) - tempf 120050000 (y-xis) - tempf 120060000 (y-xis) .......  tempf 190010000 (y-xis) - tempf 210010000 (y-xis) - tempf 500010000 (y-xis) and so on.

 

Thanks! Smiley Happy

 

                      

0 Kudos
Message 3 of 18
(3,133 Views)

I'm still not entirely clear on what you're trying to do here.

 

You have 1 time column and 9 data columns.  Is your intent to have 9 plots on a single graph with time on the x-axis?

0 Kudos
Message 4 of 18
(3,112 Views)

Parse Relap5.png

I think this will work if you want to see your 9 data series.

0 Kudos
Message 5 of 18
(3,107 Views)

Dear Friend Taki1999,

I have not tried your suggestion. I'll do it! Smiley Happy

For the avoidance of doubt, I am sending you the attached file with the variables I want to read with LabVIEW. The txt file is in Excel (.xls).

 

Variable names are in red and the values ​​of variables in yellow. Number of the graph in blue.

Note that along the file the variables are repeated every 98 s.
Example: time = 0 to 98 s, 100 s to 198 s, 200 s to 298 s, and so on!

Please, see all .xls file to you understand! See the file until the end!


For example, I'd like to read the variables on 2 graphs (Graph 1 and Graph 2)!

 

Thanks for your valuable help!  Smiley Happy

 

Thank you!

0 Kudos
Message 6 of 18
(3,096 Views)

Is it a good assumption that each block of interrest starts with

"               (K)          (K)          (K)          (K)          (K)          (K)          (K)          (K)          (K)          "

 

If yes, then you can use the attached vi to extract each block from the file, wherever they may be in the file.

The result is a 3D array where each page is one individual block.

From that 3D array combine the pages as requested for your graphs.

 

Hope this helped!

0 Kudos
Message 7 of 18
(3,092 Views)

Dear Friend Alain S,

Sorry!

I can not open your suggestion (Read file.vi).  SubVI's are missing:

1 - String to 1D Array_ogtk.vi;

2 - Multi-line String to Array_ogtk.vi

 

Could you fix it?

 

Thanks!

 

0 Kudos
Message 8 of 18
(3,083 Views)

You better download the OpenG tools from this page.

 

Attached the missing OpenG vi's and an updated version of the code since:

a) You also need the data with only 6 (K) instead of 9

b) The last block has only 1 row of data instead of 50

 

Have fun... ...

0 Kudos
Message 9 of 18
(3,079 Views)

It's unclear in your Excel sheet which rows belongs to Graph 1 or Graph 2 since all cells have a blue backcolor.

Please update or even better try something in LV based on the 3D array and come up with a suggestion Smiley Wink

 

0 Kudos
Message 10 of 18
(3,075 Views)