Currently, the first part of the script, shown below, only looks for the first field in the database, or in this case the "ID" field. I want it instead to use the Listing field.ID|Category|Name|Image|Description|Price|Taxable|thumb|Listing
Thanksopen DATA,$data; $line=<DATA>; @fields=split('\|',substr($line,0,index($line,";"))); %data=(); while (<DATA>) { my(@flds)=@fields; shift(@flds); my(@temp)=split('\|',substr($_,0,index($_,";"))); my($id)=shift(@temp); while ($#flds>-1) { if ($temp[0] eq "no") { $temp[0]=""; } $data{$id}{shift(@flds)}=shift(@temp); } } close DATA;
In reply to Re: Re: Database question: pulling a particular field from a flat database
by koacamper
in thread Database question: pulling a particular field from a flat database
by koacamper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |