#!/usr/bin/perl use strict; use warnings; open (FILE, 'my_file.txt'); while () { chomp; my ($a, $b, $c, $d, $e, $f, $g, $h) = (split)[0,1,2,3,4,5,6,7,8]; # it doesn't work here cause of the spaces in the names it # print data to get it ready to be inserted into db print "$a - $b - $c - $d - $e - $f - $g - $h\n"; } close (FILE); exit;
Test file: 2009122233388675647 9988230 2009-01-01 JOE DOE JR JOEDOEJRWX@EMAIL.COM COMPANY JOES C. LTD., CORP. 1900-01-01 00:00:00.000 1900-01-01 00:00:00.000 20091222333886756 99882308K 2010-01-01 JOE DOE JOEDOEJRWX@TEST.COM COMP INS / CORP. LTDA 1900-01-01 00:00:00.000 1900-01-01 00:00:00.000