Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

READ .dat file

by praveenzx (Novice)
on Jul 26, 2010 at 07:21 UTC ( #851334=perlquestion: print w/replies, xml ) Need Help??

praveenzx has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, Is there any method/module to read .dat files in perl ,line by line .. thanks, Praveen~

Replies are listed 'Best First'.
Re: READ .dat file
by BioLion (Curate) on Jul 26, 2010 at 08:45 UTC

    as stated above, .dat isn't a format, just an extension, so you can read the file just like a regular text file.

    See open, perlio, and also you can search the previous answers in the Monastery ( e.g. here ), which will give you plenty to get started on. You can also look through CPAN for the various file handling modules.

    Hope this helps, let us know how you get on (remember to post any code and error messages and example data you write/get/use)

    Just a something something...
Re: READ .dat file
by dHarry (Abbot) on Jul 26, 2010 at 09:58 UTC

    .dat is a general file extension which can be mapped to many formats (see e.g. file-extensions). The general Perl statements for opening and reading from a file can be used. Maybe there are Perl modules available on CPAN to parse the data/ease your life. What kind of data is actually in the file?



Re: READ .dat file
by Anonymous Monk on Jul 26, 2010 at 07:40 UTC
    .dat is not a file format

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://851334]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2021-10-25 06:31 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (89 votes). Check out past polls.