Sponsored Content
Top Forums Shell Programming and Scripting Extracting recording using egrep Post 302862629 by rbatte1 on Friday 11th of October 2013 06:35:36 AM
Old 10-11-2013
You could try with the expression similar to this:-
Code:
grep "^[0-9]*,[0-9]*, ,009[19] inputfile

I think that this translates as:-
  • ^ - from start of line
  • [0-9] - the digits
  • * - repeated as many times as needed
  • , - the literal character which is your field separator
  • This is shown twice, then a space and the string starting 009 then either a 1 or a 9.

Does that get you started? You may need to use grep -E or egrep with the character | as a logical or between them if you want to have multiple options, e.g.:-
Code:
grep -E "^[0-9]*,[0-9]*, ,009[19]|^[0-9]*,[0-9]*, ,9[19]|^[0-9]*,[0-9]*, ,[0-9]*,009[19]|^[0-9]*,[0-9]*, ,[0-9]*,9[19] inputfile


I hope that this helps. I might have missed the point, so please show me some more input & expected results along with what you have tried & the output and I will see if we can refine it a bit.



Robin
Liverpool/Blackburn
UK
This User Gave Thanks to rbatte1 For This Post:
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
All times are GMT -4. The time now is 03:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy