Header Replace characters

Hi,

I have a flat file with header with tab delimiter.

nbr id name salesid detail num source num jun_2007 jul_2007 aug_2007 sep_2007 ....feb_2008

I need to modify the header for the columns
nbr to Id1
jun_2007 to Jun07
jul_2007 to Jul07
aug_2007 to Aug07
sep_2007 to Sep07
oct_2007 to Oct07
.
.
.
.
.
feb_2008 to Feb08

Can any one please give me the command to run a shell script passing this flat file as parameter.

I heard it wud be awk to read the first reocrd. File has 10K rows.

Thanks in advance

I show the input file, then the command to reformat the data. It is going to the screen, but you could redirect to a file.
The fix to the header breaks out the header line, then does all the changes via sed as you noted. (You can add more.) The command then continues with the ; (semi-colon) and issues another command -- the tail command to give me everything except for the header line.

> cat file1
nbr id name salesid detail num source num jun_2007 jul_2007 aug_2007 sep_2007 
line 1
line 2
line 3
line 4
line 5

> head -1 file1 | sed "s/nbr/Id1/" | sed "s/jun/Jun/" | sed "s/jul/Jul/" | sed "s/aug/Aug/" | sed "s/sep/Sep/" | sed "s/_2007/07/g" ; tail +2 file1
Id1 id name salesid detail num source num Jun07 Jul07 Aug07 Sep07 
line 1
line 2
line 3
line 4
line 5

Seems you have alonf list of replacement to be done.If that is the case, Prepare a file in the below format:

s/search_str1/replace_str1/
s/search_str2/replace_str2/
...

and use

sed -f pattern_file < input_file > output_file

@joeyg one-liner simplified:

sed "1s/nbr/Id1/;s/jun/Jun/;s/jul/Jul/;s/aug/Aug/;s/sep/Sep/;s/_20//g" file