Parsing CSV File

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sainiamit25
    New Member
    • Jul 2007
    • 40

    Parsing CSV File

    Hi All,

    I want to parse a csv using perl. My script is placed in /usr/local. I have got a running code from the internet but when i try to execute that code on my system, i get the following error:-

    Can't locate Text/CSV.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at ./test.pl line 4.

    Looks like i am missing on something like importing a package. Can somebody help me out on this.

    Thanks in advance for your help

    Amit
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by sainiamit25
    Hi All,

    I want to parse a csv using perl. My script is placed in /usr/local. I have got a running code from the internet but when i try to execute that code on my system, i get the following error:-

    Can't locate Text/CSV.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at ./test.pl line 4.

    Looks like i am missing on something like importing a package. Can somebody help me out on this.

    Thanks in advance for your help

    Amit
    It looks like the module that you are using in the script is not installed on the machine it is running on. You may want to log into the machine where the script is sitting and (if you have access to do so ) run:

    Code:
        perl -MCPAN -e 'install <module>'
    where <module> is the name of the module you are using in your code. That will install the module on the system.

    Also, if you could, please be sure to copy and paste the code in question so we can better help you troubleshoot.

    Regards,

    Jeff

    Comment

    • sainiamit25
      New Member
      • Jul 2007
      • 40

      #3
      Hi Jeff,

      Thanks very much for your help.
      I tried hand earlier in the day and was able to download and install the module. And it worked well too. But now i have to parse the XML file instead of csv, so i am trying my hand at it. I will try to install the XML::Simple module in the same way mentioned by you. Will keep you and everybody posted. Anyways thanks once again for your quick and very very helpful reply.

      Regards,
      Amit

      Comment

      Working...