in reply to Stripping a seemingly complicated comma-delimited file

Perhaps CSV would do the trick for you. This module is designed to work with comma seperated files.

For your problem I'm really not sure what you are asking. To split up a file like this you could use something like:
while (<FILE>){ @split_vals=split /,/,$_; #process line in @split_vals }
Or to get the whole file in one big array:
while (<FILE){ push @split_vals=split /,/,$_; } #process whole split file.

Replies are listed 'Best First'.
Re: Re: Stripping a seemingly complicated comma-delimited file
by jamesSA (Initiate) on Jun 11, 2001 at 17:59 UTC
    yeh i can get it into an array but its really messy. you're talking about pushing each value seperated by a comma into an array variable which ive done ... but it wont help. effectively im trying to break each line into 14 variables. those variables will ultimately be shoved into a db table. So i need to 14 $variables that in the loop will keep generating new values and populate the db table. i'd prefer not to use the CSV module,actually trying to learn the hard way :>
      Well in that case instead of using @array=split/,/,$_ just use the ($var1,$var2...) syntax, no real difference (Though personally I'd rather assign to the array and call the values by $array[5] instead of $var5 :-).

      Not using CSV is your perogative, though if any of your fields have any chance of having an embedded comma in them, it gets tricky to split the values.