I am trying to split a text file into two different files, file looks something like this:
//ABC12//burrito (line of text)
(line of text)
(line of text)
etc
//ABC12//taco (line of text)
(line of text)
(line of text)
etc
//ABC12//taco (line of text)
(line of text)
(line of text)
etc
//ABC12//burrito (line of text)
(line of text)
(line of text)
etc
So I would want to split any line beginning with burrito and all subsuquent lines into a file called burrito until a line with taco in it was read, I think the best way to do this would be:
for each line in $text;
if line contains burrito
outputfile=burrito
line>>$outputfile
elseif line contains taco
outputfile=taco
line>>$outputfile
else
line>>$outputfile
but I am not sure, any help would be appreciated.