Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Regex for non-patterned input

by mtmcc (Hermit)
on Aug 15, 2013 at 11:39 UTC ( [id://1049561]=note: print w/replies, xml ) Need Help??


in reply to Regex for non-patterned input

Does your data have to be all in a single array?

If your data has tabs/spaces/newlines where they should be, you can just split on the tab, and not just on any space, something like this:

#!/usr/bin/perl use strict; use warnings; use HTML::Table; my $table = new HTML::Table(-border=>0.2, -bgcolor=>'#F4F5F7', -head=> ['ColumnA','ColumnB','ColumnC', 'ColumnD', 'ColumnE']); + while ( <DATA> ) { my @row = split (/\t/, $_); $table->addRow(@row); } print $table; __DATA__ cOne cTwo cThree 13 sec cFour cOne cTwo cThree 11 sec cFour cOne cTwo cThree 1 min 2 sec cFour cOne cTwo cThree 13 sec cFour

Log In?
Username:
Password:

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

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

    No recent polls found