Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Being able to parse that example (or CSV data likewise) is exactly why I started implementing multi-byte separation characters.

As said elsewhere in this thread, if I am happy with the result, I'll try to also implement quotation and escapes as such. Quotation being on a way higher priority than escapes. Current state in development:

$ cat films.csv
🎥Film🎥🎬🎥Year🎥🎬🎥Awards🎥🎬🎥Nominations🎥🎬🎥Director🎥
🎥12 Years a Slave🎥🎬2013🎬3🎬9🎬🎥🎥🎥 Steve McQueen🎥
🎥Argo🎥🎬2012🎬3🎬7🎬🎥🎥🎥 Ben Affleck🎥
🎥The Artist🎥🎬2012🎬5🎬10🎬🎥🎥🎥 Michel Hazanavicius🎥
🎥The King's Speech🎥🎬2010🎬4🎬12🎬🎥🎥🎥 Tom Hooper🎥
🎥The Hurt Locker🎥🎬2009🎬6🎬9🎬🎥🎥🎥 Kathryn Bigelow🎥
🎥Slumdog Millionaire🎥🎬2008🎬8🎬10🎬🎥🎥🎥 Danny Boyle🎥
🎥No Country for Old Men🎥🎬2007🎬4🎬8🎬🎥🎥🎥 Joel Coen
🎥🎥 Ethan Coen🎥
🎥The Departed🎥🎬2006🎬4🎬5🎬🎥🎥🎥 Martin Scorsese🎥
$ head -1 films.csv | dump
DUMP 0.6.01

00000000  F0 9F 8E A5 46 69 6C 6D  F0 9F 8E A5 F0 9F 8E AC    ....Film........
00000010  F0 9F 8E A5 59 65 61 72  F0 9F 8E A5 F0 9F 8E AC    ....Year........
00000020  F0 9F 8E A5 41 77 61 72  64 73 F0 9F 8E A5 F0 9F    ....Awards......
00000030  8E AC F0 9F 8E A5 4E 6F  6D 69 6E 61 74 69 6F 6E    ......Nomination
00000040  73 F0 9F 8E A5 F0 9F 8E  AC F0 9F 8E A5 44 69 72    s............Dir
00000050  65 63 74 6F 72 F0 9F 8E  A5 0A                      ector.....

$ perl -C3 -MCSV -E'csv (out => *STDOUT, in => csv (in => "films.csv", sep => "\N{CLAPPER BOARD}"))'
"🎥Film🎥","🎥Year🎥","🎥Awards🎥","🎥Nominations🎥","🎥Director🎥"
"🎥12 Years a Slave🎥",2013,3,9,"🎥🎥🎥 Steve McQueen🎥"
"🎥Argo🎥",2012,3,7,"🎥🎥🎥 Ben Affleck🎥"
"🎥The Artist🎥",2012,5,10,"🎥🎥🎥 Michel Hazanavicius🎥"
"🎥The King's Speech🎥",2010,4,12,"🎥🎥🎥 Tom Hooper🎥"
"🎥The Hurt Locker🎥",2009,6,9,"🎥🎥🎥 Kathryn Bigelow🎥"
"🎥Slumdog Millionaire🎥",2008,8,10,"🎥🎥🎥 Danny Boyle🎥"
"🎥No Country for Old Men🎥",2007,4,8,"🎥🎥🎥 Joel Coen"
"🎥🎥 Ethan Coen🎥"
"🎥The Departed🎥",2006,4,5,"🎥🎥🎥 Martin Scorsese🎥"
$

Enjoy, Have FUN! H.Merijn

In reply to Re^7: Speeds vs functionality by Tux
in thread Speeds vs functionality by Tux

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-23 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found