Hello,
I have a requirement to ignore few lines in a file before keyword FILEHEADER . As soon as there is keyword FILEHEADER is identified in file , it will form another file with data from FILEHEADER to whatever in file after FILEHEADER.
I wrote
filename=$1
awk '/FILEHEADER/{a=$1;sub(".*FILEHEADER","",a);b=$2}/FILEHEADER/{print > a"_Src_"b".txt"}' $filename
but this is not working . Also its a fixed width file
Data format example
FILEHEADERTESTA 212012234234
test1
test2
File to be formed with name like TESTA_Src_21.txt