Append data to first column delimited file

Hi,

I have a data like

Input:
12||34|56|78
Output:
XYZ|12||34|56|78

I tried like this , but it puts it on another line


awk -F "|" ' BEGIN {"XYZ"} {print $0} 'file  

Any quick suggessitons in sed/awk ? am using HP-UX

Try:

sed 's/^/XYZ|/' file
1 Like

Hello,

Could you please try the following command for same.

awk '{print "XYZ|"}'1 ORS=""  filename

It will show output as follows.

XYZ|12||34|56|78

Thanks,
R. Singh

1 Like

cool , both the solution works .... thanks a lot :slight_smile: