Extracting recording using egrep


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Extracting recording using egrep
# 8  
Old 10-18-2013
Code:
^(.*,){2}.*, *[0+]{,2}91

Please tell me if I have understood correctly, trying to color code to make it obvious what I'm looking at. The above expression equates to:-

From the start of line
Zero or more characters finishing in a comma (a field to us)
Twice
Another field
Zero or more spaces
A zero or a plus character
{,2} - okay I'm stuck on this one.
Literal string 91

For the one I'm stuck on, i have something telling me about {3}, {3,} or {3,6} but not the format you have. I could guess that it is 'less than or equal to 2' but my simple testing doesn't seem to get very far.



Robin
# 9  
Old 10-18-2013
Quote:
Originally Posted by rbatte1
[CODE].
.
.
Another field
--> can be one or more fields
Zero or more spaces
A zero or a plus character
{,2} - okay I'm stuck on this one. --> zero, 1, or 2 of these (={0,2})
Literal string 91
.
.
.
Actually, the more I look at my code, the more I see it needs some improvements/corrections, as I didn't test it against ALL possible input constellations. It worked for the file given, also for a handful of other test cases, but there may be uncovered cases.
Anyhow, my grep (grep (GNU grep) 2.14) did not complain on that {,2}, but you may be right that this is not a usual extended regex.
This User Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Recording stats for Comcast

The last few weeks I've had a problem with Comcast in San Francisco (anyone else sharing the same issue ? Please share !) During the late afternoon throughout early morning hours I see a high amount of dropped packets and increased latency when pinging my favorite destinations, like 8.8.8.8. ... (1 Reply)
Discussion started by: SandmanCL
1 Replies

2. OS X (Apple)

Any mac software for recording keystrokes

I'm trying to find a good keylogger that doesn't come with any viruses. It happens to me several times that my browser crashes when I am in article writing or some other thing, very annoying. Thus, I need a keylogger to keep all my keystroke recorded. I 'v tried some, like the Aobo Mac Keylogger,... (1 Reply)
Discussion started by: Bluerosen
1 Replies

3. Shell Programming and Scripting

recording command outputs in background

For example: % ls /store > list.txt % less list.txt % 1.txt % 2.txt I want to execute 'ls' in verbose and store the result in background to 'list.txt' so i dont have to execute another command just to view the contents of the 'list.txt' % ls /store > list.txt % 1.txt % 2.txt %... (2 Replies)
Discussion started by: jehrome_rando
2 Replies

4. UNIX for Dummies Questions & Answers

search ")" with egrep - egrep: syntax error

Hi Guys, we have a shell script which basically query the Database which retrieves huge data and use the data with "egrep" . Now there is some data which contains characters like "abc)" and the same is used like below : "egrep (.+\|GDPRAB16\|GDPR/11702 96 abc)\|$ temp.txt" now while... (7 Replies)
Discussion started by: sagarjani
7 Replies

5. Post Here to Contact Site Administrators and Moderators

My game scores are not recording

Hi. I scored 38 on the hex game and it would not record my score. Strange. (2 Replies)
Discussion started by: MokoMoko
2 Replies

6. Shell Programming and Scripting

Recording a UNIX Session

Hi All, I have a question regarding recording the unix sessions. I know the recording can be done using script comman, however i want to create a daily file of unix session. Also when i open multiple sessions how will the script multiple session. Please suggest some solutions also which file... (0 Replies)
Discussion started by: amitkhiare
0 Replies

7. UNIX for Dummies Questions & Answers

Egrep cheat sheet anywhere? Looking for meaning of egrep -c

Hi I've been searching google and have not found what egrep -c means. Does anyone know where I can get a cheat sheet or what that -c means? thanks, Linda (2 Replies)
Discussion started by: leelm
2 Replies

8. IP Networking

Data recording on Network

Hello, I have been task to record data on the network between two computers. On one side I have a Solaris 8 computer and on the other side there is a VX/Works machine. The messages that come across are data messages using a UDP protocol on a dedicated IP address. Does Solaris have anything I can... (4 Replies)
Discussion started by: rtoba
4 Replies

9. UNIX for Dummies Questions & Answers

recording keystrokes in vi

What is the syntax for recording command in vi. If I want to repeat a command over and over. My file is 12/01/05,,adsmte,9,0,0 12/02/05,,adsmte,12,0,0 12/03/05,,adsmte,10,0,0 12/04/05,,adsmte,11,0,0 12/05/05,,adsmte,10,0,0 12/06/05,,adsmte,10,0,0 12/01/05,,tsmpc1,57,1,2... (5 Replies)
Discussion started by: reggiej
5 Replies
Login or Register to Ask a Question