![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum 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 |
| Replace Junk chars (Sed) | alfredo123 | Shell Programming and Scripting | 4 | 02-27-2008 03:38 PM |
| Using SED to get n chars after given value from file | Kally | UNIX for Dummies Questions & Answers | 12 | 12-19-2007 01:54 AM |
| How to convert C source from 8bit chars to 16bit chars? | siegfried | Shell Programming and Scripting | 0 | 09-26-2007 11:26 AM |
| cut last 4 chars | pbsrinivas | Shell Programming and Scripting | 5 | 06-28-2007 09:14 PM |
| replace ascii chars without loosing it. | braindrain | Shell Programming and Scripting | 4 | 02-01-2006 06:02 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
replace chars,
I want to replace the particular text in the middle of the line. Ex. In the line 40-50 wanted to replace the char as 'x' |
| Forum Sponsor | ||
|
|
|
|||
|
If x="21312312dennis3123123123"
echo ${x/dennis/xxxxxx} x will be 21312312xxxxxx3123123123 now echo $x |sed 's/dennis/xxxxxx/' will also give the same result. I hope this is what you are expecting!! |
|
|||
|
Try this if you have a very big file (say 100k records)
cut -c1-9 file > tempfile1 cut -c10-15 file | tr -cd "\n" "X" > tempfile2 cut -c15- file > tempfile3 paste -d"" tempfile1 tempfile2 tempfile3 |
|||
| Google The UNIX and Linux Forums |