Append file name to the begining of each line

view full story

http://www.unix.com – I want to append file names at the beginning of a line for each row file content Code: abc.txt.gz 123|654|987 bcd.txt.gz 876|trf|kjh I want a single output file with below format Code: abc.txt.gz|123|654|987 bcd.txt.gz|876|trf|kjh This one is working but only with unzip files,need to have something like this working with zip files as i cannot unzip the files ... Code: awk '{print FILENAME ?"|" $0}' ${file} Moderator's Comments: Please use code tags next time f (HowTos)