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

Re^2: Text::CSV on Unicode file

by dd-b (Monk)
on Jun 07, 2017 at 23:29 UTC ( [id://1192309]=note: print w/replies, xml ) Need Help??


in reply to Re: Text::CSV on Unicode file
in thread Text::CSV on Unicode file

And adding "nothing.nothing" to the end of the header line (so there isn't that trailing comma, but without changing the number of commas) made zero difference to the output, still get the exact same error.

Replies are listed 'Best First'.
Re^3: Text::CSV on Unicode file
by Tux (Canon) on Jun 09, 2017 at 06:29 UTC

    You can auto-generate headers for empty fields:

    my @hdr = $csv->header ($fh, { munge_column_names => sub { state $i; $_ || "nothing.".$i++ }});

    That would result in these headers:

    Volume.label Volume.serialno Volume.vtype Volume.netname Volume.filesystem Path.name nothing.0 Thumbnail.checksum Thumbnail.width Thumbnail.height Thumbnail.horiz_res Thumbnail.vert_res Thumbnail.colortype Thumbnail.colordepth Thumbnail.gamma Thumbnail.thumbnail_width Thumbnail.thumbnail_height Thumbnail.thumbnail_type Thumbnail.thumbnail_size Thumbnail.name Thumbnail.metric1 Keywords.pkeywords nothing.1

    Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1192309]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-19 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found