Hi all,
I have a csv file and I am using the Text::CSV_XS module to parse it. This works fine.
However, for a particular column (the 8th one), I need to truncate the field to only having 50 characters. For example, if the field has 90 characters in total, I need to delete everything from the 51st character and onwards. If the field contains only 30 characters, then do nothing. I'm not sure how I can do this in Perl. Is there a function that counts the number of characters in the field?
Thanks a lot for the help!
-Lory
I have a csv file and I am using the Text::CSV_XS module to parse it. This works fine.
However, for a particular column (the 8th one), I need to truncate the field to only having 50 characters. For example, if the field has 90 characters in total, I need to delete everything from the 51st character and onwards. If the field contains only 30 characters, then do nothing. I'm not sure how I can do this in Perl. Is there a function that counts the number of characters in the field?
Thanks a lot for the help!
-Lory