in reply to Re: Re: making a single column out of a two-column text file
in thread making a single column out of a two-column text file

I'll now try to figure out a way to make Perl decide if the mask has really found the column separation or not.

This task is going to be really input specific. BrowserUK and I have both shown you ways to calculate the probability that the column break falls at a certain column (although BrowserUK's method is cleaner, more robust, and more fluent perl than my own). I don't really see how you can "check" this result in a general fashion short of applying some machine learning technique that is likely to be less reliable than the probabilistic approach. That said, knowing something about your input, such as the size of the column break, and how may breaks of that size will be found in a line (I'm thinking of the numbers that fall to the right of the rhc here) will let you apply the mask to various inputs with a high likelihood of success.

  • Comment on Re: Re: Re: making a single column out of a two-column text file