Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Best Way To Parse Concordance DAT File Using Modern Perl?

by space_monk (Chaplain)
on Dec 09, 2012 at 06:48 UTC ( #1007956=note: print w/ replies, xml ) Need Help??


in reply to Best Way To Parse Concordance DAT File Using Modern Perl?

Furher to what 2teez said, simply use Text::CSV or one of its close relatives to parse the file. You can change the field/end of line separators simply by specifying them when you instantiate the object. e.g. in the case of Text::CSV:

$csv = Text::CSV->new ({ quote_char => '"', escape_char => '"', sep_char => ',', eol => $\, always_quote => 0, quote_space => 1, quote_null => 1, binary => 0, keep_meta_info => 0, allow_loose_quotes => 0, allow_loose_escapes => 0, allow_whitespace => 0, blank_is_undef => 0, empty_is_undef => 0, verbatim => 0, auto_diag => 0, });
It also has support for encoding format etc.
A Monk aims to give answers to those who have none, and to learn from those who know more.


Comment on Re: Best Way To Parse Concordance DAT File Using Modern Perl?
Download Code
Replies are listed 'Best First'.
Re^2: Best Way To Parse Concordance DAT File Using Modern Perl?
by Jim (Curate) on Dec 09, 2012 at 18:19 UTC

    Unfortunately, Text::CSV_XS doesn't work. It can't parse Concordance DAT files like the one I described.

    Is there another way?

    Jim

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2015-07-08 02:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls