![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| merging two files | rameshonline | Shell Programming and Scripting | 14 | 04-06-2009 01:20 AM |
| merging of 2 files AWK, SHELL or something else | klut | Shell Programming and Scripting | 24 | 03-20-2009 09:45 AM |
| Merging 2 .CSV files in Unix | chachabronson | UNIX for Dummies Questions & Answers | 6 | 08-05-2008 03:11 AM |
| merging of 2 files AWK - part 2 | pp56825 | Shell Programming and Scripting | 2 | 02-11-2008 10:14 PM |
| Merging two files | venommaker | UNIX for Dummies Questions & Answers | 4 | 01-10-2008 08:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
|||||
|
Sorry friends,
Even Im also trying for the same things, Actually I have 4 report files each contains Jobs name, order date, run date and status. I have to generate one resultant report which looks to be: job name Order date run date status I've tried to select each column values into seperate variables and used echo. echo "$var1\t" >> result.report echo"$var2\t" >> result.report echo "$var3\t" >> result.report echo "$var4\n" >> result.report It is working well but I want to know are there any ways to achieve this? Your help will be appreciated. Many Thanks and Regards. Love |
|
||||
|
Hi,
Try this way... Let us say, your data is in file1 file2 file3 and file4. -------------------------------------------------------------------------- #!/bin/ksh rm a1 b1 c1 d1 cat file1 | while read record do echo $record | cut -d" " -f1 >> a1 done cat file2 | while read record do echo $record | cut -d" " -f1 >> b1 done cat file3 | while read record do echo $record | cut -d" " -f1 >> c1 done cat file4 | while read record do echo $record | cut -d" " -f1 >> d1 done paste a1 b1 c1 d1 -------------------------------------------------------------------------- Best Regards, Sridhar M Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|