The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by mwexler]

Newbie question:

I have been doing some research (at cpan.org), and I have not been able to
find a routine which would use some simple heuristics to guess at a delimiter,
similar to how Excel guesses when doing a file import.

I would assume that either someone wrote a module to do this, or that its so
simple that I just don't see the trick, but I am missing it.

Most of the files I deal with are either tab or comma delimited, so I tried
just counting the number of commas or tabs and picking whichever was bigger...
and that failed miserably, since it ignored the fact that commas can be in the
fields in tab delims.

Anyway, if you know some pseudo code or a module such as
"text::guessdelimimport" or something of that sort, I would appreciate it.

Thanks for any advice you can share,

Michael
import-bot (20211) [Avatar] Offline
#2
Re: Guess the Delimiter?
[Originally posted by dave]

Michael,

I don't know of any module that does this, but can see that it would be a very
useful thing to have.

Why don't you have a go at writing it and submit it to CPAN. If you need any
help, feel free to email me (dave@dave.org.uk).

Dave...