Hi,
There is probably an easy solution to this but I can't figure it out. I am looking to:
- take a CSV file into an array and...
- loop through the array and split fields into variables
- if the array field is empty then set the variable to "N/A"
Note: it is only the setting the $variable to "N/A" that I can not get
ie:
foreach $var (@list) {
($name,$date,$size, etc...)=split(/,\"/,$var);
}
How would I set $date to "N/A" if the field in the array is empty??
so to produce:
$name = Jim
$date = N/A
$size = small
I Hope this makes sense to someone and I hope there is an easy fix!
THANKS!!!