Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help deleting a column of data...

Status
Not open for further replies.

fsanchez13

Technical User
May 9, 2003
35
US
I have data that is formatted like below and I need to delete everything that is in the first column down. I am sure this is easy but for some reason I can seem to do it.

50 25 37 45 50
51 22 99 66 83
52 45 67 23 50
53 123 12 123 445

56 23 345 57 45
57 34 34 76 556
78 34 45 76 345
56 34 567 8889 33

45 23 34 67 89
34 67 90 87 54
12 45 67 54 32
45 678 654 567 8990

Please help!!!
 
sed 's/[^ ]* *//' infile

or use cut

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
nawk '{$1=""; print}' myFile.txt

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Is there a way to look at the first number and if that number is lets say 56 then print that line? also I would need the time stamp to be on the line it prints

22:30:30
50 25 37 45 50
51 22 99 66 83
52 45 67 23 50
53 123 12 123 445
22:30:30
56 23 345 57 45
57 34 34 76 556
78 34 45 76 345
56 34 567 8889 33
22:59:30
45 23 34 67 89
34 67 90 87 54
56 45 67 54 32
45 678 654 567 8990


 
Try this (untested) awk program

/:/{a=$0}
$1==56{print a &quot; &quot; $0}

CaKiwi

&quot;I love mankind, it's people I can't stand&quot; - Linus Van Pelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top