Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Split of text

by sundialsvc4 (Abbot)
on Apr 09, 2014 at 17:44 UTC ( #1081703=note: print w/ replies, xml ) Need Help??


in reply to Split of text

Well, the short-answer would be, “very carefully!”   Because, even in this snippet of data, I see inconsistencies.   Some lines appear to begin with pct while others do not.   The last line of your example is very different.

It will be crucial that you design your program to be suspicious.   It should aggressively test every assumption that it makes, so that it will die (on its own ... descriptively ...) when it encounters any line of data that does not perfectly meet those assumptions.   This is because, in the real world, programs such as this one are the only way for anyone to know whether there are any inconsistencies in the input-data.   (Yes, you are effectively “debugging” that upstream program, and yes, on a very-regular basis you will find bugs in it.)   You need to design these programs so that, if they run to completion, then you have in this a very strong indicator that all of the data ... and there could of course be many megabytes of it per-run ...is okay.   And that, therefore, the results produced are probably reliable.

Put such tests into the program from the very start, until you are absolutely sure all is well.   Then, and only then ... leave them in!


Comment on Re: Split of text
Re^2: Split of text
by AnomalousMonk (Abbot) on Apr 09, 2014 at 18:38 UTC
    It will be crucial that you design your program ...

    You offer much wise advice. Unfortunately, I think droberts2014 isn't interested in designing anything. I think droberts2014 thought it would be worth spending thirty seconds of time to plunk a great wadge of (probably unusable) 'data' down in the middle of the site, slap "if there are multiple entries then just make more colums Thanks for the ehelp!!" on it, and sit back and see what happened. (Anyone notice any cross-posting? Wouldn't be surprised...)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-12-28 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls