![]() |
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 |
| Complex find grep or sed command | sjburden | Shell Programming and Scripting | 3 | 05-31-2008 10:45 PM |
| parse through one text file and output many | sophiadun | UNIX for Dummies Questions & Answers | 14 | 02-20-2008 06:08 AM |
| complex grep command | naamas03 | Shell Programming and Scripting | 0 | 11-21-2007 04:59 AM |
| parse text file | craggm | Shell Programming and Scripting | 9 | 02-27-2007 02:13 AM |
| parse text file | klick81 | Shell Programming and Scripting | 3 | 12-18-2006 12:04 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
parse text or complex grep ?
I have the following file (records from db) and I need to retrieve in another file only two variables and their values. I have a command but works only for one value.
grep ^mob: R25-subs.ldi | sed 's/mob: //' | sort | uniq >text_output Can someone please help me? dn: cn=30693xxxxxxx,ou=sub,o=company mob: x_var pref: aaaaaaaa sn: 30693xxxxxxxxxxx userpassword: xxxxxxxxxx allowmt: true searchon: mms3069xxxxxxxx searchon: mars30693xxxxxxx allowmo: true objectclass: xxxx objectclass: xxxx objectclass: xxxx objectclass: xxxx objectclass: xxxx objectclass: xxxx uid: 30693xxxxxx cn: 30693xxxxxx community: xxxxxx orclguid: xxxxxxxxxxxxxxxxxxxx creatorsname: cn=xxxxxxxx modifiersname: cn=xxxxxxxx createtimestamp: 2003xxxxxxxx modifytimestamp: 2003xxxxxxxx dn: cn=30693xxxxxxxx,ou=subscribers,o=company mob: y_var sn: 30693xxxxxxx userpassword: xxxxxxxxxxxx allowmt: true searchon: mms30693xxxxxxx searchon: mars3069xxxxxxx allowmo: true objectclass: xxxxx objectclass: xxxxx objectclass: xxxxx objectclass: xxxxx objectclass: xxxxx objectclass: xxxxx uid: 30693xxxxxx cn: 30693xxxxxx community: xxxxxx orclguid: xxxxxxxxxxxxxxxxxxxxxxxxxx creatorsname: cn=xxxxxxx modifiersname: cn=xxxxxxx createtimestamp: 20030212073811 modifytimestamp: 20040309041005 pref: bbbbbbbbb ...etc How can I have an text output from the above block as: x_var aaaaaaa y_var bbbbbbb or something like that ?????? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|