Create a gist now

Instantly share code, notes, and snippets.

["COLLOQ_TYPE", "COLLOQ_NAME", "COLLOQ_CODE", "XDATA"]
["S", "BELT,FAN", "003541547", undef]
["S", "BELT V,FAN", "000324244", undef]
["S", "SHROUD SPRING SCREW", "000868265", undef]
["S", "D REL VALVE ASSY", "000771881", undef]
["S", "YBELT,V", "000323030", undef]
["S", "YBELT,'V'", "000322933", undef]
[]
[]
use 5.14.2;
use strict;
use warnings;
use Text::ParseWords;
use Data::Dump qw( pp );
sub csv_split {
return [ quotewords ',' , 0, shift ];
}
while (<DATA>) {
chomp;
pp csv_split( $_ );
}
__DATA__
COLLOQ_TYPE,COLLOQ_NAME,COLLOQ_CODE,XDATA
S,"BELT,FAN",003541547,
S,"BELT V,FAN",000324244,
S,SHROUD SPRING SCREW,000868265,
S,"D" REL VALVE ASSY,000771881,
S,"YBELT,"V"",000323030,
S,"YBELT,'V'",000322933,
S,"YBELT HAS A LINE
FEED IN IT",00000001,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment