LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read a part of text file between pattern matches in lv?

The text file I am reading is
 
#HEAD
....
....
....
#ENDHEAD
....
....
 
With this file, how can I read only the part between #HEAD and #ENDHEAD?
 
Thanks
JH
0 Kudos
Message 1 of 4
(2,853 Views)
Hi advix,

read the whole file and do some mattern patching... If it is a very big file you may try to read in the file in chunks!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,837 Views)

Yes I can read the whole file, use pattern match with regular expression. But I couldn't make lv code which was working.

Sample code?

Thanks

JH

0 Kudos
Message 3 of 4
(2,807 Views)
Match Pattern vi has 3 outputs, before pattern, pattern, and after pattern.  Call Match Pattern with the header as the pattern.  Wire "after" output into another Match Pattern, using the footer as the pattern.  The "before" output will be everything between header and footer.
- tbob

Inventor of the WORM Global
Message 4 of 4
(2,803 Views)