djose
asked on
Export/Import CSV file to Unix DBM database online using cgi programming
I need to create a webpage using cgi programming to build an admin. tool so that the user can import/export a csv file into a Unix DBM database to update it.
Thank you.
Thank you.
you need to look at a perl module, DBD::CSV, it might work for what you want
ASKER
I have already written a code in perl to export the dbm filet to csv.....still can't figure out how to import the csv file into the dbm. Can someone write the code for me or give a sample....How much points is that worth?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the suggestion, here is the sample code:
@WriteOrder = ("data1","data2");
# Define location of datafile
$DataFile = $ENV{"DOCUMENT_ROOT"} . "/data/" . $query->param("ReferenceNu mber") . ".csv";
# Write the data to file
open (DATAFILE, ">>$DataFile");
foreach $Field (@WriteOrder) {
@Values=$query->param($Fie ld);
$Value=join("\|",@Values);
$Value=~s/\"//g;
print DATAFILE "\"$Value\",";
}
print DATAFILE "\n";
close (DATAFILE);
@WriteOrder = ("data1","data2");
# Define location of datafile
$DataFile = $ENV{"DOCUMENT_ROOT"} . "/data/" . $query->param("ReferenceNu
# Write the data to file
open (DATAFILE, ">>$DataFile");
foreach $Field (@WriteOrder) {
@Values=$query->param($Fie
$Value=join("\|",@Values);
$Value=~s/\"//g;
print DATAFILE "\"$Value\",";
}
print DATAFILE "\n";
close (DATAFILE);