Formatting Output file

Hi, I have a file....

File1:

Num Name ID Place ADDR City Country
1024|Name1|ID1|Street1|ADDR1|Boston|UK
1025|Name2|ID3|Street2|ADDR2|London|USA

The above file is varaiable length file. I have to insert 2 values in every record of the above file.

Output:

1024|Name1|XX|ID1|Street1|ADDR1|YY|Boston|UK
1025|Name2|XX|ID3|Street2|ADDR2|YY|London|USA

As given above I need XX and YY values at third and Seventh column of every record in the file.

Please let me know how to do it. Thanks in advance.

# cat aaa
Num Name ID Place ADDR City Country
1024|Name1|ID1|Street1|ADDR1|Boston|UK
1025|Name2|ID3|Street2|ADDR2|London|USA

# awk  'FS=OFS="|" {if (NR == 1) print $0; else print $1,$2,"XX",$3,$4,$5,"YY",$6,$7}' aaa
Num Name ID Place ADDR City Country
1024|Name1|XX|ID1|Street1|ADDR1|YY|Boston|UK
1025|Name2|XX|ID3|Street2|ADDR2|YY|London|USA

Hi, Thanks for the reply.I have given the above command .... Its working for all the records except for first record......... Please let me know how to append the values for first record also.

Of course it skipped the first line - you wrote it was supposed to be:
Num Name ID Place ADDR City Country

If you want to apply the rule to all line, ignore the condition that refers to the first line:
if (NR == 1) ...