← Back to team overview

zim-wiki team mailing list archive

Re: howto strip metadata header

 

On Fri, Mar 2, 2012 at 9:55 PM, Adam Porter <adam@xxxxxxxxxxxxx> wrote:

> Of course, then I remembered that old adage, "Those who don't know
> Unix are doomed to reinvent it, poorly."  :)
>
> $ find . -iname "*.txt" | while read f; do tail -n +5 "$f" | cat >"$f";
> done
>
>

On Fri, Mar 2, 2012 at 9:55 PM, Adam Porter <adam@xxxxxxxxxxxxx> wrote:

> Of course, then I remembered that old adage, "Those who don't know
> Unix are doomed to reinvent it, poorly."  :)
>
> $ find . -iname "*.txt" | while read f; do tail -n +5 "$f" | cat >"$f";
> done
>
>
I'm impressed (7 minutes coding!), will give the python version a try since
I'm on windows, otherwise will fire up Cygwin to try the bash one.

What I did in the meantime was load all the .txt files up into my coding
editor and regex-S&R'd on the beginning three "strings+.*+\n", replacing
with nothing. A kludge, but it worked.

Thanks. . .

References