Can anyone assist ? I have a large .txt (115,000 lines) that contains many variable length sub-sections stacked on top of each other; I need to extract each subsection text between Common seperators & save extraction to a seperate text file (with *.LOG extension). The extract file name is embedded in Line 3 of each subsection eg "gOILp_u" Given file size Need to automate/loop/ this RegEx process with a Perl script/function.
For each subsection: ------ Start String: "WinSolve log file created " End String: "Exit" File Name to Save Extracted subsection text to: Occurs on Line 3 of each subsection
(eg1 1st subsection Line 3 reads:
@ gRSH1p_u @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
(eg2 2nd subsection Line 3 reads:
@ gOILp_u @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
So 1st subsection => saved to c:\data\ws3\sim\LOGS\gRSH1p_u.LOG So 2nd subsection => saved to c:\data\ws3\sim\LOGS\gRSH1p_u.LOG
SECTION (TOP) OF LARGE FILE TO BE SPLIT:------------------etc etcWinSolve log file created @ @ gRSH1p_u @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ [TRUNCATED SUBSECTION TEXT] @ Exit @ WinSolve log file created @ @ gOILp_u @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ [TRUNCATED SUBSECTION TEXT] @ Exit @ WinSolve log file created @ @ gTRX1p_u @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ [TRUNCATED SUBSECTION TEXT] @ Exit
SUMMARY OF REQUIREMENT --------------
1st subsection, extract all text between "WinSolve log file created " & "Exit" ; save to c:\data\ws3\sim\LOGS\gRSH1p_u.LOG
2nd subsection, extract all text between "WinSolve log file created " & "Exit" ; save to c:\data\ws3\sim\LOGS\gOILp_u.LOG
3rd subsection, extract all text between "WinSolve log file created " & "Exit" ; save to c:\data\ws3\sim\LOGS\gTRX1p_u.LOG etc etc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |