Replace column values from other file

I have one file as it has the following format

File1

S No   Site            IP Address
1         Australia    192.168.0.1/26
2         Australia    192.168.0.2/26
3         Australia    192.168.0.3/26

I need awk/sed command to replace the column2 value ( under Site) with some other value ( example UK) and Column3 value ( Under IP address) needs to replaced from other file ( File 2) which has the IP address contents like this

File2

IP Address
10.100.10.1/25
10.100.10.2/23
10.100.10.3/24

So the new file File3 should be like this

S No   Site            IP Address
1          UK            10.100.10.1/25
2          UK            10.100.10.2/23 
3          UK            10.100.10.3/24

Is this a homework assignment?

What difference does it make whether or not you use File1? It seem that all you have in File3 is a new header line, a line sequence number, a random string that the script makes up on the fly, and the contents of File2.

Hi Don

Thanks for reply.Yes, we can use the file 1 to have all the replacement values and new file entries.

You did not answer Don Cragun's question on homework assignment, nor did you show any efforts from your side. So all hints I can give you for now is to skip file1 and read file2 in a loop, adding the two desired columns to each line before printing it out.

RudiC/Don
I am very new to this forum ( do not understand the meaning of home work assignment )and shell script. Hence requires your help.

Please be somewhat creative and consult a dictionary for exact translations of homework assignment. If you are a student and your teacher gives you problems to solve off class times, that's homework.
And, as long as you don't show some efforts from your side to tackle the problem, little help can/will be offered from our side.

Thanks all for your help and encouragement. In the below code, it erases all the delimit value ( i.e ^I) between two columns in the file.

awk 'NR==FNR {a[FNR]=$1;next} {if(FNR>1){$3=""a[FNR]}}1' file1 file > file3

So i modified as below but ^I value added in entire file and didnt give the proper input

awk 'NR==FNR {a[FNR]=$1;next} {if(FNR>1){$3=""a[FNR]}}1' OFS="\t" file1 file > file3

So my question is, how do i replace the column values without modifying the exiting delimit value?

Please use code tags as required by forum rules!

I'm not sure I understand your problem. Setting OFS to <TAB> will certainly separate all output fields with <TAB>s. What delimiter do you want, and where?

The submitter refuses to answer the homework question, so I have to assume that this is homework and the submitter is trying to get us to do the homework without following the proper procedures. Refusing to use CODE tags isn't helping either.

This thread is closed.