Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

How to conditionally display and remove first line only?

$
0
0
I have a maildir hierarchy of 90k eml files and;

1) I would like to walk the tree and display the first line from any file, whose first line begins with;

From -

That's "From space dash space" and only if it's the first seven characters, of the first line in the file.

2) I would also like to count the number of files who have this first line

3) I then would finally like to completely remove that line from those files

Thanks,

Jason

P.S. I only really need 3, but I would love to do 1 and 2 first. TIA

Viewing all articles
Browse latest Browse all 16232

Latest Images

Trending Articles



Latest Images