how to insert new coloum


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to insert new coloum
# 1  
Old 12-23-2005
Data how to insert new coloum

Dear friends,

I have a dataset like this
2.18 66.86 27.9
2.18 66.86 27.9
2.18 66.86 27.9
2.15 66.88 27.9
2.15 66.88 27.9


Now i have another dataset containing date coloum like this

22-12-2005
22-12-2005
22-12-2005
22-12-2005
22-12-2005

Now i want to insert this data coloum in first dataset as a third coloum

so my final data set should like this

2.18 66.86 22-12-2005 27.9
2.18 66.86 22-12-2005 27.9
2.15 66.88 22-12-2005 27.9
2.15 66.88 22-12-2005 27.9

how to get his awk will work

please help

regards
rajan
# 2  
Old 12-23-2005
please help
# 3  
Old 12-23-2005
cat datefile | paste firstfile - | awk '{ print $1,$2,$4,$3 }'
# 4  
Old 12-23-2005
thank u it is working
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Insert line

Hello Is there any sed command to insert a line after nth line... have a file of 500000 lines Thanks (4 Replies)
Discussion started by: Madiouma Ndiaye
4 Replies

2. Linux

How to insert EOL?

How can I insert End of line (EOL) in Unix to file. Thanks (5 Replies)
Discussion started by: mrn6430
5 Replies

3. Shell Programming and Scripting

Search and Insert

Hi All I got one problem and want your help,what i want to do is Input 123 key0=A;B;C;:key1=X;Y;Z;: here 123 is a username I should search the username (in this case it is 123) in file and if found it should insert the additional string D as below Here 123 and key are tab seperated ... (6 Replies)
Discussion started by: parthmittal2007
6 Replies

4. Shell Programming and Scripting

How to insert a char in every two?

Hi, I've written a script to interrogate all fibre devices on our systems and output the WWNs to a file. I now want to insert a ":" every 2 characters into the WWN so I can write another script to create aliases within the SAN. So the current file has WWNs in the following format;... (2 Replies)
Discussion started by: h8mmer
2 Replies

5. Shell Programming and Scripting

Insert Header Name

Can anyone help. I have sql to CSV showing header with ALIAS names but I want to generate CSV file with user friendly name i.e from AIAN8 to Adress Book Number etc. SELECT AIAN8 || , || F0101.ABALPH || , || AICO || showing following below in CSV output intead of above Address... (4 Replies)
Discussion started by: s1a2m3
4 Replies

6. Shell Programming and Scripting

add coloum value based on first coloum

Hi i have a file and i want to add the coloum values like 9067 is coming twice here so o/p willbe like 9067,sum of 3rd coloum,sum of 4th coloum 9015 is coming 0nce then o/p 9015,15,6 sum is happening based on first coloum it will add all the third coloum and 4th coloum value where first... (1 Reply)
Discussion started by: aaysa123
1 Replies

7. Shell Programming and Scripting

compare 2 coloum of 2 diff files using perl script

Hi, i am new to perl scripting.. i am still learing it.. i am asked to write a perl script which should compare 2 coloums of 2 different files. if those 2 coloumn are same the script should store the both the lines in 2 diff files. these are files, file 1: 21767016 226112 char 19136520... (3 Replies)
Discussion started by: vasuki
3 Replies

8. Shell Programming and Scripting

parse coloum in a file

I have a file like the format 000002371627240000023716272455577818030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001099001099425%00109925%IPY 2007013120070227Y99991231N YYX SRT0001010125%0000503318882HANDH800 R... (3 Replies)
Discussion started by: vaskarbasak
3 Replies

9. UNIX for Dummies Questions & Answers

How do I insert x'0D' ?

I'm directing output to a *.dat file. The first byte is a variable, the second must be a carriage-return (x'0D'). Is there a UNIX equivalent of an ASCII command that will allow me to output this byte? (2 Replies)
Discussion started by: rchuttke
2 Replies

10. UNIX for Dummies Questions & Answers

help me to to insert data

hi, am new to unix can any one help me to insert data to afile to a specified column. ie to an output file with csv format i should insert some data to 2,3,4 fileds and the data in those fields should move to next fields eg: output file asd,12,12,12,12,1,2,1,1,1,1,1... (10 Replies)
Discussion started by: babu@shell
10 Replies
Login or Register to Ask a Question