The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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 07:23 AM
deleting specific lines from all files in a directory vrms UNIX for Dummies Questions & Answers 3 04-25-2008 11:08 AM
deleting lines from multiple text files vrms Shell Programming and Scripting 3 04-25-2008 11:01 AM
Deleting Lines from .CSV Files 009satya Shell Programming and Scripting 1 11-13-2006 03:30 PM
PHP Outputting finite amount of lines from a file pondlife Shell Programming and Scripting 1 10-26-2005 11:44 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-14-2006
benair benair is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 3
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!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:07 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0