Skip to content

Instantly share code, notes, and snippets.

@kentfredric
Created October 31, 2011 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentfredric/1329436 to your computer and use it in GitHub Desktop.
Save kentfredric/1329436 to your computer and use it in GitHub Desktop.
["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