Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
OQ91@BBCPC36662 /cygdrive/c/package $ perl -MData::Dump -MFile::Slurp -e " dd scalar read_file shift, { qw +/ binmode :raw / }; " hitters > ThatFilesBytesAsPerlAsciiCode.pl <br>thanks to your code I can tell the search string I'm looking for i +s \xAO<br> OQ91@BBCPC36662 /cygdrive/c/package $ cat ThatFilesBytesAsPerlAsciiCode.pl "3B\xA0Aramis Ramirez\xA0(R)\nC\xA0Jonathan Lucroy\xA0(R)\nCF\xA0Carlo +s Gomez\xA0(R)\n2B\xA0Rickie Weeks\xA0(R)\n1B\xA0Yuniesky Betancourt\ +xA0(R)\nP\xA0Yovani Gallardo\xA0(R)\nCF\xA0Robbie Grossman\xA0(S)\n2B +\xA0Jose Altuve\xA0(R)\nC\xA0Jason Castro\xA0(L)\nLF\xA0J.D. Martinez +\xA0(R)\n1B\xA0Chris Carter\xA0(R)\nDH\xA0Carlos Pena\xA0(L)\nRF\xA0J +immy Paredes\xA0(S)\n3B\xA0Matt Dominguez\xA0(R)\nSS\xA0Marwin Gonzal +ez\xA0(S)\nRF\xA0Eric Young Jr.\xA0(S)\nCF\xA0Dexter Fowler\xA0(S)\nL +F\xA0Carlos Gonzalez\xA0(L)\nSS\xA0Troy Tulowitzki\xA0(R)\nC\xA0Wilin + Rosario\xA0(R)\n1B\xA0Todd Helton\xA0(L)\n3B\xA0Nolan Arenado\xA0(R) +\n2B\xA0Josh Rutledge\xA0(R)\nP\xA0Jon Garland\xA0(R)\nSS\xA0Everth C +abrera\xA0(S)\nCF\xA0Will Venable\xA0(L)\n3B\xA0Chase Headley\xA0(S)\ +nLF\xA0Carlos Quentin\xA0(R)\n1B\xA0Yonder Alonso\xA0(L)\n2B\xA0Jedd +Gyorko\xA0(R)\nRF\xA0Chris Denorfia\xA0(R)\nC\xA0John Baker\xA0(L)\nP +\xA0Jason Marquis\xA0(L)\n"

$ cat hitters | perl -ne 'print substr($_,index($_,"\xA0")+1,-5); print "\n";'
Nolan Arenado
Josh Rutledge
Jon Garland
Everth Cabrera
Will Venable
Chase Headley
Carlos Quentin
Yonder Alonso
Jedd Gyorko
Chris Denorfia
John Baker
Jason Marquis

Now I can do something like:
grep -f hitters bigger_file_to_search

OQ91@BBCPC36662 /cygdrive/c/package
$ grep -f dirty dirt | sort
1B Adam LaRoche 2.1 40 WAS@SDP $2,700
1B Billy Butler 2.7 39 KAN@OAK $3,600
1B Brandon Belt 2.2 41 SFG@COL $3,100
1B Brandon Moss 2.3 44 KAN@OAK $3,500
1B Brett Pill 2 3 SFG@COL $2,600
1B Chad Tracy 0.4 23 WAS@SDP $2,300
1B Daric Barton 1.3 8 KAN@OAK $2,400
1B Eric Hosmer 1.6 37 KAN@OAK $3,400
1B Lance Berkman 2.8 37 DET@TEX $3,600
1B Mark Kotsay 0.7 24 WAS@SDP $2,700
1B Mitch Moreland 2.7 43 DET@TEX $3,300
1B Nate Freiman 1.2 20 KAN@OAK $2,700
1B Prince Fielder 3.4 41 DET@TEX $4,700


THANK YOU VERY MUCH

In reply to Re^2: search for chr() fails by tbone654
in thread search for chr() fails by tbone654

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (9)
    As of 2015-07-03 16:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (54 votes), past polls