New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved autosplit mode #14647
Comments
From @epaCreated by @epaThe -a and -F options to perl are useful to work on column-formatted data. perl -F, -aE '$F[0] = uc $F[0]; print join ",", @F' Note that 'say' at the end. Perl takes care of splitting the input Clearly the -a flag could be more useful but it is too much of a backwards perl -F, -AE '$F[0] = uc $F[0]' perl -AE '@F = reverse @F' # reverse words on each line and so on. This -A flag would be more useful than -a IMHO, If you feel that perl's command line is busy enough already I Perl Info
|
From @TuxOn Mon, 13 Apr 2015 02:09:37 -0700, "Ed Avis" (via RT)
I note the *absence* of say at the end :)
indeed
I like your proposal, but I hate your example
Giving CSV as example is very dangerous. Your example already fails $ cat test.csv The next version will be even shorter: $ perl -MText::CSV_XS=csv -wE'csv(in=>"test.csv",filter=>{1=>sub{$_=uc}})' $ perl -Mblib -MText::CSV_XS=csv -wE'csv(in=>"test.csv",filter=>{1=>sub{$_=uc},3=>sub{s/D.uh/Yeah/;1}})'
-- |
The RT System itself - Status changed from 'new' to 'open' |
From @epaIndeed, I confused myself with say vs print, which kind of proves my point. I have a slightly revised proposal. The new -A flag would - first chomp the string That lets you use -Ap or -i -A to filter column data and just -A to simply read it (but without having to care about the final newline). -- ______________________________________________________________________ |
From @rjbs* Ed Avis <eda@waniasset.com> [2015-04-13T05:59:15]
Why not use -l for the chomp-and-append-newline-later behavior? -- |
From @epaThanks Ricardo S., you are right that -l would deal with chomp and adding back newline. -- ______________________________________________________________________ |
Migrated from rt.perl.org#124290 (status was 'open')
Searchable as RT124290$
The text was updated successfully, but these errors were encountered: