Text::CSV_PP is able to parse that text, at least in UTF-8.
use v5.12;
use warnings;
use utf8::all;
use Text::CSV_PP;
my $csv = Text::CSV_PP->new (
{ binary => 1 ,
quote_char => '🎥' ,
escape_char => '🎥' ,
sep_char => '🎬' } )
or die "Cannot use CSV_PP: "
.Text::CSV_PP->error_diag ();
my @rows;
my $fh = *DATA;
while ( my $row = $csv->getline( $fh ) ) {
push @rows, $row;
}
$csv->eof or $csv->error_diag();
for ( @rows ) {
printf("%-25s%s\n", $_->[0], $_->[4]);
}
__DATA__
🎥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🎥
Output:
Film Director
12 Years a Slave 🎥 Steve McQueen
Argo 🎥 Ben Affleck
The Artist 🎥 Michel Hazanavicius
The King's Speech 🎥 Tom Hooper
The Hurt Locker 🎥 Kathryn Bigelow
Slumdog Millionaire 🎥 Danny Boyle
No Country for Old Men 🎥 Joel Coen 🎥 Ethan Coen
The Departed 🎥 Martin Scorsese
-
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.
|