Computing.Net > Forums > Office Software > Unix reqular expression usage

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Unix reqular expression usage

Reply to Message Icon

Name: priya99
Date: July 30, 2009 at 12:06:34 Pacific
OS: Windows XP
Product: Hp (hewlett-packard) 4/8gb dat dds2 scsi se narr surestore dat8eu w/ obdr unix
Subcategory: General
Comment:

I would like to know how can I use a regular expression to search a string in a line and also in a file

I am using

head -2 | egrep "^_([a-z])_$" | wc -c

it only displays the row, but not the count.

My file looks like:

_version_|N|02313.00| | | _fxtrans_| USD|HOK|

I need to grep _xxxx_ string and print it and also count the occurance.

In above line it should print _version_ _fxtrans_ and output as 2



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


formula to compare the va... Fraps LP5 error



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Unix reqular expression usage

outlook express 2007 www.computing.net/answers/office/outlook-express-2007/9165.html

Outlook Express www.computing.net/answers/office/outlook-express-/5976.html

downloading Outlook Express www.computing.net/answers/office/downloading-outlook-express/6757.html