CSV decoding through perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tspatil
    New Member
    • Feb 2008
    • 2

    CSV decoding through perl

    I am decoding the csv file with the split command but my problem is I am having some field which are in double quotes and the values inside that are having comma, which is resulting the single field is getting divided into two.

    Please can some one help me
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    The easiest thing would be to use the Text::CSV or better still Text::CSV_XS modules as they know how to handle the data thats in the double-quotes. They might have to be installed though because they are not core modules, even though they should be IMHO.

    Comment

    • eWish
      Recognized Expert Contributor
      • Jul 2007
      • 973

      #3
      tspatil,

      I deleted the other post you made regarding the same issue. Please do not double post your questions.

      Thank You,

      Moderator

      Comment

      • tspatil
        New Member
        • Feb 2008
        • 2

        #4
        Originally posted by KevinADC
        The easiest thing would be to use the Text::CSV or better still Text::CSV_XS modules as they know how to handle the data thats in the double-quotes. They might have to be installed though because they are not core modules, even though they should be IMHO.
        Hi KevinADC,

        Please can you help me how to do this.

        I am new to perl scripting.

        Thanks

        Comment

        • eWish
          Recognized Expert Contributor
          • Jul 2007
          • 973

          #5
          CPAN is where you can find the modules that Kevin listed. Read the documentation and look through the examples given. Then give them a try and if you still have problems, post the code that you have tried and we will try to help. Please don't just copy and paste the sample code and expect results. The documentations is the key.

          It is all up to you now.

          --Kevin

          Comment

          Working...