All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu Chen <chen@hhmi.umbc.edu>
To: Fabio Zyserman <zyserman@fcaglp.unlp.edu.ar>
Cc: linux-admin@vger.kernel.org
Subject: Re: deleting N lines of many files
Date: Fri, 17 Dec 2004 09:01:35 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0412170858111.3952@chen-pc.hhmi.umbc.edu> (raw)
In-Reply-To: <41C2D20A.70404@fcaglp.unlp.edu.ar>

you can try this, in the parent directory of all these directories, type

find ./ -name "DATA_File_name" -exec sed "1,${N}d" {} > NEW_file_name \;

should be enough, you will have both new and old files, after 
confirmation, you can move new ones to overwrite old ones.

Chen

On Fri, 17 Dec 2004, Fabio Zyserman wrote:

> Hi all,
>
> I have about eighty directories,
> called data-nn, where nn=00,01,02,....
> in each of these directories I have
> among others, an (ascii) data file with many thousends
> lines. This data file has the same name in all
> directories.
>
> I would like to know if it is possible,
> via a bash script, to delete the first N
> lines in this data file in all directories.
> The modified file can overwrite the old one.
>
> Many thanks in advance,
>
> Fabio Zyserman
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


===========================================
Yu Chen
Howard Hughes Medical Institute
Chemistry Building, Rm 182
University of Maryland at Baltimore County
1000 Hilltop Circle
Baltimore, MD 21250

phone: 	(410)455-6347 (primary)
 	(410)455-2718 (secondary)
fax: 	(410)455-1174
email: 	chen@hhmi.umbc.edu
===========================================

  parent reply	other threads:[~2004-12-17 14:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-17 12:33 deleting N lines of many files Fabio Zyserman
2004-12-17 13:07 ` zavandi
2004-12-17 14:01 ` Yu Chen [this message]
2004-12-17 20:01 ` Jeff Woods

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0412170858111.3952@chen-pc.hhmi.umbc.edu \
    --to=chen@hhmi.umbc.edu \
    --cc=linux-admin@vger.kernel.org \
    --cc=zyserman@fcaglp.unlp.edu.ar \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.