Hello there new to this, but glad I like headaches, and found this forum. I was looking for a way to scan a text file and move certain lines to another text file and delete the removed line form the original file. Ok, I found a script to do the first part, but script stops after the first instance and closes instead of continuing. Can someone take a look and figure out what I am doing wrong?
Code:
proc main
string strLine
fopen 0 "c:\cdtps.txt" READ ; File with original data
fopen 1 "c:\fallout.txt" CREATE ; File with extracted data
while not feof 0
fgets 0 strLine ; get a single line of data
if strfind strLine "bldn" ; find beginning of block
fputs 1 strLine ; save beginning of block
while not feof 0 ; loop withing the block
fgets 1 strLine ; continue getting data
if strfind strLine "" ; look for end of block
fputs 1 strLine ; save end of block
exitwhile ; done extracting block
else
fputs 1 strLine ; keep writing block
endif
endwhile
exitwhile ; done with file
endif
endwhile
fclose 0
fclose 1
endproc