![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need help cutting consecutive lines with sed or awk | raghin | Shell Programming and Scripting | 2 | 06-04-2008 01:59 AM |
| Cutting specific lines from a file | pathanjalireddy | Shell Programming and Scripting | 6 | 06-02-2005 06:45 AM |
| Cutting n consecutive lines from a file... | Vishnu | UNIX for Dummies Questions & Answers | 2 | 10-18-2002 07:49 AM |
| max charachters for usernames | m.szylkarski | UNIX for Dummies Questions & Answers | 1 | 02-01-2002 07:50 AM |
| Cutting lines out using sed I presume. | cfoxwell | UNIX for Dummies Questions & Answers | 5 | 01-07-2002 08:13 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Cutting the top two lines, and also charachters below.
Hey all. I have a file that I am trying to cut information out of. We have a script that shows us all of our Radio Scanners that are being used and I'm writing a script that clears all of the context off of the scanners. The script that runs shows us this information below...
|emp_id |first_name|last_name |base_unit|radio_id| |---------|----------|--------------------|---------|--------| |S990CA2 |CORY |AUKERMAN | 1| 66| |S990LR4 |LARRY |ROGERS | 1| 67| |S990EF1 |ELIZABETH |FREDRITZ | 1| 69| |S990JG7 |JARED |GEORGE | 1| 70| |S990SM9 |SANTOS |MELCHOR JR. | 1| 71| |S990RB8 |RONNIE |BOWLIN | 1| 73| |S990MW3 |MEGAN |WARE | 1| 74| |S990ML1 |MICHAEL |LOWERY | 1| 75| |S990HW2 |HAMER |WOLFE | 1| 77| |S990RB13 |RAY |BYERLY | 1| 81| |S990DM3 |DEAN |MULVAINE | 1| 82| |S990JH3 |JAY |HARTMAN | 1| 84| The only info that I need are emp_id and the Radio_id. The only problem is, I don't know how to cut the top 2 or 3 lines to erase the headers. I have the characters that I need cut out just fine, but I'm not so sure about the top 2 lines. Any help would be great. Thanks a lot. |
| Forum Sponsor | ||
|
|
|
|||
|
Yes, "sed" needs an input. This is a basic requirement of all such utilities. sed can take its input from stdin or from referencing a file.
Example 1: Code:
cmd | cmd | cmd | sed '1,2d' Example 2: Code:
sed '1,2d' your_really_big_file Quote:
|