![]() |
|
|
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 convert C source from 8bit chars to 16bit chars? | siegfried | Shell Programming and Scripting | 0 | 09-26-2007 03:26 PM |
| replace chars, | Jairaj | Shell Programming and Scripting | 7 | 02-28-2007 06:34 AM |
| replace ascii chars without loosing it. | braindrain | Shell Programming and Scripting | 4 | 02-01-2006 10:02 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Replace Junk chars (Sed)
I know this has been asked previously on this forum...But I think I have a different scenario to present. I ahve a file tht looks like this (note:there are control Z and other chars tht are not visible on line with anme bowers) Code:
BB7118450 6004718 BIANCALANA =HEI BZ5842819 1493750 ZACHAR=/ AB1250620 0300080 BOWERS MR0408256 0458355 DYCUS/BOWERS/PA AB9381233 6811741 BOWERS *6* BL6039588 0184195 LIMERES JR. | AD1901253 0458720 DURAZO - CELAYA BE4340698 0609541 EL-HAJJAOUI(LUN AH5528267 6786292 HARSANY, JR ++ BD0762662 4527818 D`SOUZA AC6629577 3059914 CANOVA` AC9130991 0485282 CARROLL ›16! AT8874679 0490912 TAIT ›20! AH8136459 0136813 HUNTER ›06! (16 This file has special chars and Control M/Z chars....I need to remove all these junk chars and replace with a space. I tried the following commands.. Code:
sed 's/[!@#\$%^&*()<>+|={}\/`-]//g' special.txt
The above worked except for the fact that the Control Z chars were not replaced. I tried Code:
tr -d '\032' < special.txt | sed 's/[!@#\$%^&*()<>+|={}\/`\"\^M\'026'-]//g' > t
but some additional chars were deleted... Any help in getting the command right would be appreciated... |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|