![]() |
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 |
| 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find and replace | javeed7 | Shell Programming and Scripting | 1 | 04-02-2008 09:00 AM |
| find and replace | rakshit | Shell Programming and Scripting | 4 | 01-24-2008 03:52 AM |
| find and replace | valhutch | UNIX for Dummies Questions & Answers | 4 | 07-29-2006 05:20 PM |
| find and replace | vikas_j@hotmail | UNIX for Dummies Questions & Answers | 3 | 02-25-2002 05:41 PM |
| Find & Replace | gagansharma | Shell Programming and Scripting | 3 | 11-27-2001 04:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
find and replace
I have statement like this
column_id.columnname=="value" in unix i want to modify above statement to variable1=="value" that means i have to replace the string before "==" by string "variable1" second catch is, in statement instead of "==" you can have any arithmatic comarision operator like !=, >, < etc... can have replace string befor first " and replace by variable1== can anyone suggest command to do this... regards mahabunta |
|
||||
|
hi i have
statement 15_REC_D>=5 here 15_REC_D needs to be replaced by `echo $line_by_line | awk -F "|" '{print $1}'` so i have used command echo -e "15_REC_D>=5" | sed 's/"15_REC_D"/"\`echo $line_by_line | awk -F "|" '{print $1}'\`"/g' but it is giving me error as sed: -e expression #1, char 58: Unterminated `s' command Any inputs on above error thanks and regards mahabunta |
|
||||
|
here's a simple python alternative:
Code:
s = "15_REC_D>=5"
replacestring = """`echo $line_by_line | awk -F "|" '{print $1}'`"""
tobereplaced , num = s.split(">=")
print replacestring,">=",num
`echo $line_by_line | awk -F "|" '{print $1}'` >= 5 |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|