![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix file operations(shell script) | nivas | Shell Programming and Scripting | 6 | 02-07-2008 03:11 AM |
| File operations | monks | UNIX for Dummies Questions & Answers | 2 | 04-26-2006 04:26 AM |
| File operations | chiragmistry21 | Shell Programming and Scripting | 2 | 03-27-2006 02:00 PM |
| where i can find list of UNIX commands for daily operations ? | mgoutham | UNIX Desktop for Dummies Questions & Answers | 1 | 03-02-2006 10:35 AM |
| mathematics operations in unix | cesar720213 | UNIX for Dummies Questions & Answers | 2 | 11-22-2001 07:24 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Unix File operations
Hi,
Iam having the two files as follows: file1: ASQWEDFR09876543121234512 POIUYTREW09876512345676788 ZXCVBNMKS1209888888888888 file2: ASQWEDFR09876543121234516 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- CXADFGTU09876543121234789 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- KLOPIUYRE09876541234234516 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- ZXSDCVFG09876512345634516 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- i WANT TO update the contents in file1 to file2 and remove the other lines. example.: ASQWEDFR09876543121234516 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- POIUYTREW0987651234567678 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- ZXCVBNMKS1209888888888888 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- |
| Forum Sponsor | ||
|
|
|
|||
|
Unix File operations
Hi,
Thanks for your reply. It is working fine, but iam having the file 2 as follows: file 2 Code:
QWERTYUI098765432112345 abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007-10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 Code:
QWERTYUI098765432112345 QWIUYTUI098765432112345 CDXRTYUI098765432112345 The above info in file1 is all in a single line. Now i want to take the lines one by one in file1 and find if there is matching record in file 2 and if it finds it should replace and most important is it should not disturb the other info in the particular line.( Previous paste command is working but it is disturbing the spaces and it is removing those spaces in file 2. Please give me the solution. Thanks in advance. Last edited by vgersh99; 02-08-2008 at 12:32 AM. Reason: vB Codes |
|
||||
|
Quote:
|