![]() |
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 |
| 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 |
| regex question | xiamin | Shell Programming and Scripting | 3 | 03-05-2009 02:53 AM |
| RegEx question has me stumped | tolmark | UNIX for Dummies Questions & Answers | 7 | 08-18-2007 06:20 PM |
| Quick regex question | retrovertigo | Shell Programming and Scripting | 1 | 07-06-2007 04:49 PM |
| Newbie Regex Question | ciremg01 | UNIX for Dummies Questions & Answers | 0 | 11-30-2005 05:30 PM |
| regex question | rocketkids | UNIX for Dummies Questions & Answers | 6 | 02-12-2004 05:49 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
regex question
I have a simple file test.out that contains data in the form of
key1=A|shift1 key2=B|shift2 key3=C|shift3 and so on. I need to get it to print A B C I can do it using lookbehind assertion such as this ( ?<==)([a-zA-Z]) yet I was wondering if there is another way of mutching single character following the '=' ?. I am fairly new to regex and so far I could not find good way of matching a part of a string after or before certain characters or set of characters other that using assertions. Any examples would be helpful. thank you in advance |
|
||||
|
Being on the same topic I have another question.
If I have files that contains following data key1^A|shift1|376 key2^B|shift key3^C|shift23|2|5 and so on how would I change first instance of the '|' to '^' ? to have something like this key1^A^shift1|376 key2^B^shift key3^c^shift23|2|5 I tried sed 's/.+\d\^[a-zA-Z]\|.*/s/.+\d\^[a-zA-Z]\^.*/' but that did not work thank you in advance |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|