Re: delete lines in subfolders

"Tim Chase [email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
On 2014-11-03 11:10, [email protected] [sed-users] wrote:
> Hi,
> How can I delete lines in files in subfolders? Im using sed for
> windows and its not working, Im trying: find E:\emls\*.eml sed -i
> "1,9 d"  
> 
> Inside emls I have subfodlers with lots of .eml files and i want to
> delete the first lines of each file.

Usually you'd farm that out to the "find" utility, something like

  find /path/to/emls -name '*.eml' -exec sed -i.bak 1,9d {} \;

This will create ".bak" files which I would want to have around
until I'd tested the results.  If they worked, you can purge them
all (assuming you don't have any other .bak files you want to keep
around):

  find /path/to/emls -name '*.eml.bak' -delete

-tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.