From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Segregating a Global Alias
Date: Mon, 24 Mar 2014 15:36:28 -0700 [thread overview]
Message-ID: <140324153628.ZM4798@torch.brasslantern.com> (raw)
In-Reply-To: <XnsA2FAB51B6E85Bdavidrayninfocouk@80.91.229.13>
On Mar 24, 5:47pm, zzapper wrote:
} Subject: Re: Segregating a Global Alias
}
} zzapper <david@rayninfo.co.uk> wrote in
} news:XnsA2FAB2C8DE4F8davidrayninfocouk@80.91.229.13:
}
} > for f in NF ; perl -ne 's/(<\/\w+>)/$1\n/g; print' < $f > $f.txt
That's fine, but it creates a variable $f that hangs around after the
command is finished.
} BTW this is perl one liner to put each XML tag on a newline.
}
} But can anyone else trump Bart's or my attempt?
Do it entirely in perl?
perl -pe '$. == 1 && open STDOUT,"> $ARGV.txt"; s/(<\/\w+>)/$1\n/g' NF
That'll work for a whole list of files just like the "for" loop.
next prev parent reply other threads:[~2014-03-24 22:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 14:43 zzapper
2014-03-24 17:22 ` Bart Schaefer
2014-03-24 17:34 ` zzapper
2014-03-24 17:47 ` zzapper
2014-03-24 18:04 ` Re[2]: " Manuel Presnitz
2014-03-25 12:28 ` zzapper
2014-03-24 18:11 ` Paul Johnson
2014-03-24 18:19 ` 'whence' anomaly Ray Andrews
2014-03-24 22:48 ` Bart Schaefer
2014-03-25 3:10 ` Ray Andrews
2014-03-25 6:25 ` Bart Schaefer
2014-03-25 15:32 ` Ray Andrews
2014-03-24 22:36 ` Bart Schaefer [this message]
2014-03-25 1:56 ` Segregating a Global Alias Bart Schaefer
2014-03-25 14:07 ` zzapper
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=140324153628.ZM4798@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).