Apr. 24th, 2013 02:24 pm

owned

zorkian: Icon full of binary ones and zeros in no pattern. (Default)
[personal profile] zorkian
[21:16] < wmoss> #server can anyone think of a way to print all lines that have two or more commas? without removing all the data?
[21:16] < wmoss> I worried this requires awk :(
[21:18] < mark> hm
[21:18] < mark> cat test | perl -ni -e '$n=$_; print $n if (s/[^,]//g && length($_) >= 2);'
[21:19] < erin> mark: haha, I don't know if that's better than awk :P
[21:19] < mark> well,
[21:19] < mark> it's certainly less awk-ward
[21:20] < erin> perl-ward
[21:20] < mark> oh come on, nobody liked the pun?
[21:20] < erin> !m mark
[21:20] < bumpbot> you're doing good work, mark!
[21:20] < mark> I expected things to be thrown
[21:20] < dowski> !clap mark
[21:20] * bumpbot claps quietly for mark, profoundly unimpressed.
[21:20] < mark> wmoss: ^^ btw
[21:23] < wmoss> yup
[21:23] < wmoss> !thank mark
[21:23] < bumpbot> you're doing good work, mark!
[21:23] < erin> wmoss: why can't you just do
[21:23] < erin> grep ".*,.*,.*" ?
[21:23] < mark> erin .. might have won this round
[21:23] < wmoss> indeed


Wherein Mark and Will come up with a solution to identify lines with more than one comma and are proud, then Erin comes in and totally destroys them.

Well played, Erin, well played.
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

zorkian: Icon full of binary ones and zeros in no pattern. (Default)
Mark Smith

April 2017

S M T W T F S
      1
2345678
91011121314 15
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 22nd, 2017 08:41 pm
Powered by Dreamwidth Studios