![]() |
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 |
| How to search and replace text in same file | Vrgurav | Shell Programming and Scripting | 1 | 04-25-2008 06:20 AM |
| search and replace in a file | satyam_sat | Shell Programming and Scripting | 2 | 04-11-2008 01:28 AM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 10:24 AM |
| Search and replace multi-line text in files | marz | Shell Programming and Scripting | 10 | 10-10-2005 08:05 AM |
| How do you search and replace a text with markerA that end with markerB | drone | Shell Programming and Scripting | 1 | 06-19-2003 09:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
automating file search and replace text
Hi, I am trying something like this: Let's say I have a file called File1 with contents:
x=-0.3 y=2.1 z=9.0 I have another file, File2, with contents: xx= yy= zz= (nothing after "="). What I want to do is get the value of x in File1 and set it to xx in File2, i.e., xx=-0.3. And the same thing for y and z, value of y will be set to yy and z to zz (yy=2.1, zz=9.0). Now, I want to do this with grep and sed and without using any other language. Also, I cannot know the numbers in File1. The process should be automatic. Is there a way to do this in the command line itself? Only one step is enough, for example, x in File1 to xx in File2 step. thanks, |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|