Right now, I have a database with around 20 columns and 70 rows. I want to iterate through each row and save each row as a separate data block, with the file name being generated by the first three columns. I already have SQL code selecting the specific columns I want and ordering it according to the parameters I want. The directory I want the files is in c:/database/first_past.
In my code, $ds is a variable that is an array of hashes, i.e. my current database. I have two for loops that iterate through the database and get down to the row, but I am unsure about the line to insert to save the row as its own separate file in the directory mentioned above with the specific title parameters.
Is this possible in Perl? Here is a portion of the code I am currently using:
for my $rec (@{$ds->{DATA}}) {
for my $role (keys %{$rec} } {
#here is the save file line? ("$role=$rec->{$role}"
}
}
$ds is an array of hashes and the DATA field is all the data for one row.
DBI,
open,printFor your follow up question:
or