Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: selecting columns from a tab-separated-values file

by CountZero (Bishop)
on Jan 22, 2013 at 07:28 UTC ( [id://1014588]=note: print w/replies, xml ) Need Help??


in reply to Re^3: selecting columns from a tab-separated-values file
in thread selecting columns from a tab-separated-values file

What's the first arg to split()? It appears to be a single blank char. How does that work to split upon tab chars?
It's a space enclosed within single quotes. It tells split to split on whitespace, e.g., \t, \n, space.
That is a dangerous thing to do. it works for your example data, but it will break on real word data where you will have LAST names like Van Winkle and CITYs called New York.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^5: selecting columns from a tab-separated-values file
by Kenosis (Priest) on Jan 22, 2013 at 07:56 UTC

    You're quite right and this has been corrected. Appreciate you catching this.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found