![]() |
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 |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| delete blank space in begining of line | karthikn7974 | Shell Programming and Scripting | 4 | 05-07-2008 04:40 AM |
| append blank space | HAA | Shell Programming and Scripting | 1 | 09-03-2007 04:43 AM |
| Replace blank spaces by single tab, and right alignment | Jae | Shell Programming and Scripting | 1 | 08-08-2007 10:58 PM |
| how to grep for blank records (space,tab,/n)? | Browser_ice | UNIX for Dummies Questions & Answers | 2 | 08-14-2006 10:47 PM |
| check for the first character to be blank | anthreedhr | UNIX for Dummies Questions & Answers | 7 | 10-22-2003 10:05 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I am not sure about what you mean: ist this the text as it is in your file or are these decimal (octal?) values for three characters in your file?
If this is text you can use the following: Code:
sed 's/12\([0-9]\)/10\1/g' /path/to/file > /path/to/other/file bakunin |
|
||||
|
No.
I will tell you clearly. i want to delete a invalid character(which i told you as example '2'.) The query should check for characters which is not present in the following A to Z, a to z , 0 to 9 and all the symbols present in the keyboard. If you have any doubts reply me. Last edited by rollthecoin; 04-16-2008 at 05:34 AM.. |
|
||||
|
Quote:
Code:
[^A-Za-z0-9.,#&@] Code:
sed '/[^A-Za-z0-9.,#&@]//g' /path/to/sourcefile > /path/to/newfile I hope this helps. bakunin |
|
||||
|
Myscript
#!/usr/bin/ksh sed '/[^A-Za-z0-9.,#&@]//g' /home/1.txt > /home/2.txt it throws error like this "sed: 0602-403 /[^A-Za-z0-9.,#&@]//g is not a recognized function." why is it so. did i do any mistake? Last edited by rollthecoin; 04-18-2008 at 03:40 AM.. |
|
||||
|
My bad, i had a typo in the script:
Code:
sed '/[^A-Za-z0-9.,#&@]//g' /path/to/sourcefile > /path/to/newfile Code:
sed 's/[^A-Za-z0-9.,#&@]//g' /path/to/sourcefile > /path/to/newfile |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|