![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search a list of lines in file into files | sriram003 | UNIX for Advanced & Expert Users | 2 | 05-20-2008 04:23 AM |
| deleting specific lines from all files in a directory | vrms | UNIX for Dummies Questions & Answers | 3 | 04-25-2008 08:08 AM |
| deleting lines from multiple text files | vrms | Shell Programming and Scripting | 3 | 04-25-2008 08:01 AM |
| Deleting Lines from .CSV Files | 009satya | Shell Programming and Scripting | 1 | 11-13-2006 11:30 AM |
| PHP Outputting finite amount of lines from a file | pondlife | Shell Programming and Scripting | 1 | 10-26-2005 08:44 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
deleting a varying amount of lines from a list of files
I did search the posts for info on this and while there were some in the ballpark, none addressed this specifically. (also I tried to post this once it said I was logged out, so hopefully I'm not sending a duplicate here).
I have a set of files (250 +/-) where I need to delete the first "$x" number of lines and output what remains to a new file (or cat all the results into one file) so far, I was able to piece together this much: cat -n index20a6.html index3e43.html index6a84.html (...and so on) | grep '<TITLE>Section 440.' | awk '{print $1}' it results in this: 973 1722 2219 ... '<TITLE>Section 440.' is on a different line in each file so the amount of line to delete will vary. The missing piece is to delete '1,973d' '1,1722d' '1,2219d' as it goes through and create a new file. (also if I can go through this list recursively rather than list all the files in my command, that would be a bonus!) Thanks for any assitance on this! |
| Forum Sponsor | ||
|
|
|
|||
|
First, Thanks for the reply!
That results in just a list of the filenames showing in "onebigoutputfile" ./index018e.html ./index0271.html ./index031c.html ./index03bb.html ./index03fe.html ./index04b3.html ... I'll continue to work with it. |
|
|||
|
I rechecked and the original cut and paste was directly from what I was running earlier. Of course, I'm no pro when it comes to working in the Shell, so I'll just have to keep working with what you posted and see where I'm going astray.
Thank you for taking the time to help with this. |
|||
| Google The UNIX and Linux Forums |