![]() |
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 |
| Perl - converting selected characters to upper/lower case | doubleminus | UNIX for Dummies Questions & Answers | 2 | 05-19-2008 01:13 AM |
| Script needed to select and delete lower case and mixed case records | abhilash mn | Shell Programming and Scripting | 1 | 03-17-2008 08:00 AM |
| Accepting Upper and Lower case | lweegp | Shell Programming and Scripting | 8 | 12-08-2007 06:57 PM |
| lower case to upper case string conversion in shell script | dchalavadi | UNIX for Dummies Questions & Answers | 3 | 05-29-2002 12:07 AM |
| Upper And Lower Case | pciatto | Shell Programming and Scripting | 1 | 04-29-2002 12:17 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Sed - Lower case single characters
Hello,
I have a file where I am supposed to convert all the single i characters to uppercase, but when I try, it converts all the i's inside of words to uppercase as well. I tried doing: cat filename | sed 's/i/I/g' but that obviously does not work. Any help would be greatly appreciated. Thanks. |
|
||||
|
Quote:
i'm the big brother. i never drink water, i only drink beer. i've got to do this job. Yes, i can do it. There should be more possibilities but try this one: Code:
sed -e 's/i/I/g' -e 's/\([a-zA-Z].*\)I\([a-zA-Z].*\)/\1i\2/g' file |
|
||||
|
Well you can specify regex "word delimiters":
Code:
/\bWORD\b/ # word is framed by blanks /\<WORD\>/ # match whole word inside < > /[[:blank:]]WORD[[:blank:]]/ # word is framed by blanks (alternate) |
![]() |
| Bookmarks |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|