in reply to Re: Convert CSV file to TAB delimited
in thread Convert CSV file to TAB delimited

Thank you for the code Utilitarian! 'tabfile.tab' is created, but it's empty. I ran the script through debug and when I look at $_, I see the data in tab format. Why is 'tabfile.tab' empty though?
  • Comment on Re^2: Convert CSV file to TAB delimited

Replies are listed 'Best First'.
Re^3: Convert CSV file to TAB delimited
by Tux (Canon) on Sep 23, 2010 at 14:33 UTC

    Because of a small error: one comma too many :)

    while (<$csv_file>) { s/\Q$sep\E/\t/g; print $tab_file, $_; # ^- That comma should not be there }

    Other than that, I still think you ought to look into the proposed Text::CSV_XS or Text::CSV solutions.


    Enjoy, Have FUN! H.Merijn
      Thank you all for taking the time to reply to my question, I really appreciate it!! Removing the comma where Tux had indicated did the trick. I don't think I would have ever figured that one out... Once again, thank you all for your time TCM