![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to combine 2 different files | rdasari | HP-UX | 1 | 03-17-2008 02:19 PM |
| Need To Combine 2 Files | goodmis | Shell Programming and Scripting | 4 | 02-21-2007 07:55 PM |
| combine two files | fredao1 | Shell Programming and Scripting | 1 | 01-08-2007 06:29 PM |
| How to combine 2 files | ravi.sadani19 | Shell Programming and Scripting | 2 | 07-12-2005 01:04 AM |
| how to combine two files | tao | UNIX for Dummies Questions & Answers | 4 | 03-21-2002 07:38 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Combine 2 files
Some one plz give me the answer
we have 3 files 1 and 2 are given and we need to get 3 file by using some trick file_one.dat AMITH ARUN ARVIND file_two.dat (these are Variables) X Y Z and we need to write scirpt in file_two.data and get the answer in file_three.dat as fallows file_three.dat X = "AMITH"; Y = "ARUN"; Z = "ARVIND"; some one plz help for geting this |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
nawk -f nekki.awk file_one.dat file_two.dat > file_tree.dat
here's nekki.awk: Code:
FNR==NR { arr[FNR] = $0; next}
{
printf("%s = \"%s\";\n", $0, arr[FNR])
}
|
|
#3
|
|||
|
|||
|
Try this for merging as you have mentioned
pr -tm file_one.dat file_two.dat | awk '{print $1"=\""$2"\";"}' > file_three.dat |
|||
| Google The UNIX and Linux Forums |