LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-06-2014, 05:47 PM   #1
karthik4455
LQ Newbie
 
Registered: Aug 2014
Posts: 9

Rep: Reputation: Disabled
how to delete the entries is all lines which falls before colon


When I copy packet data from a tool it's like this:
0000 : 00 90 FB 23 2F 9D B8 AC 6F 13 D1 91 08 00 45 00
0010 : 00 4F D2 63 40 00 40 06 6F B2 0A 40 67 94 B8 69
0020 : CE 55 F0 02 00 19 63 AE 3C 2D 5F A7 47 C0 80 18
0030 : 00 2E EA 4C 00 00 01 01 08 0A 5D C6 F2 33 22 BB
0040 : 66 F3 52 43 50 54 20 54 4F 3A 3C 33 37 33 36 31
0050 : 38 37 37 40 71 71 2E 63 6F 6D 3E 0D 0A

When I try to decode I need to enter like this:
00 90 FB 23 2F 9D B8 AC 6F 13 D1 91 08 00 45 00
00 4F D2 63 40 00 40 06 6F B2 0A 40 67 94 B8 69
CE 55 F0 02 00 19 63 AE 3C 2D 5F A7 47 C0 80 18
00 2E EA 4C 00 00 01 01 08 0A 5D C6 F2 33 22 BB
66 F3 52 43 50 54 20 54 4F 3A 3C 33 37 33 36 31
38 37 37 40 71 71 2E 63 6F 6D 3E 0D 0A

Which command is appropriate to perform this function?
 
Old 08-06-2014, 07:04 PM   #2
karthik4455
LQ Newbie
 
Registered: Aug 2014
Posts: 9

Original Poster
Rep: Reputation: Disabled
sorted

I sorted this using: cat test | cut -d ":" -f2,2
 
Old 08-06-2014, 08:16 PM   #3
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Pipe the output into awk instead of dumping it into "rip.txt...
Code:
awk -F ":" '{print $2}' rip.txt
Output
Code:
 00 90 FB 23 2F 9D B8 AC 6F 13 D1 91 08 00 45 00 
 00 4F D2 63 40 00 40 06 6F B2 0A 40 67 94 B8 69 
 CE 55 F0 02 00 19 63 AE 3C 2D 5F A7 47 C0 80 18 
 00 2E EA 4C 00 00 01 01 08 0A 5D C6 F2 33 22 BB 
 66 F3 52 43 50 54 20 54 4F 3A 3C 33 37 33 36 31 
 38 37 37 40 71 71 2E 63 6F 6D 3E 0D 0A

Last edited by dijetlo; 08-06-2014 at 08:18 PM.
 
Old 08-08-2014, 06:48 AM   #4
bloodstreetboy
Member
 
Registered: May 2012
Posts: 201
Blog Entries: 3

Rep: Reputation: 37
Run :
Quote:
awk -F ":" '{print $2}' test > output.txt
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to copy some lines in a file and delete these lines after gartura Linux - General 1 07-20-2010 08:55 AM
[SOLVED] Delete all lines containing a string, plus 4 lines below it? RedHelix Linux - Newbie 4 01-27-2010 09:13 AM
Delete Duplicate Lines in a file, leaving only the unique lines left xmrkite Linux - Software 6 01-14-2010 06:18 PM
How to delete LDAP entries struggled_newbie Linux - Newbie 1 11-03-2009 02:56 AM
awk/gawk/sed - read lines from file1, comment out or delete matching lines in file2 rascal84 Linux - General 1 05-24-2006 09:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration