![]() |
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 |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 10:24 AM |
| sed search and replace | d__browne | UNIX for Dummies Questions & Answers | 7 | 04-26-2006 09:46 AM |
| how to search for a str and replace it.. | sekar sundaram | Shell Programming and Scripting | 6 | 12-29-2005 06:11 PM |
| Search and replace sed or tr | bridgeje | Shell Programming and Scripting | 6 | 10-28-2003 07:54 AM |
| search and Replace | mukeshannamalai | UNIX for Advanced & Expert Users | 4 | 09-14-2001 06:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Search and Replace in Ksh
All
I need a code in Ksh to search and replace a string in a file. File A --- AAAA A BBBB B CCCC C DDDD E FFFF F File B: -------- AAAA BBBB CCCC DDDD After running the script. I need the File B to be in following format A B C D I use grep command to get corresponding value from file A Then I tried to replace those values in file B echo "s/$value1/$value2/\nwq!" | ex -s $FileB I used a while loop and converted one by one. But I got the following result File B: AAAA BBBB CCCC D Please help to solve this situation. Thanks in advance Deepak |
|
||||
|
Hi,
I had a similar requirement sometime back. Check up the 'join' command in UNIX. The idea is to join (join as in a table-join in relational databases) the files using the first column and extracting the last column of the second file. Unfortunately, I dont have a UNIx box right now, and cant give you a concrete example. Thanks, Abhishek Ghose |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|