sed command to skip the first line during find and replace operation

Hi Gurus,

I did an exhaustive search for finding the script using "sed" to exclude the first line of file during find and replace.
The first line in my file is the header names.

Thanks for your help..

sed '2,$s/PATTERN1/PATTERN2/' filename
awk 'NR==1{print}NR>1{sub(/PATTERN1/,"PATTERN2");print}' filename
1 Like
sed '1d; s/PATTERN/REPLACEMENT/' filename
1 Like

Try

sed '1 ! s/pattern/replacement/' file
1 Like

Hello All,

Thanks for your prompt reply. All codes works well.

Sidda