in reply to dbi::anydata
Something like the following may work for convertion:
Where the first line is the field names, so you know what order to load everything in, and \t is the delimiter. If there's a chance there may be tabs in the data, you'll want to use a different delimiter, same goes for \n for end of record.my (@keys, $out); @keys = sort keys %$D; print join "\t", @keys; print "\n"; $out = ''; $out .= $D->{$_} . "\t" for @keys; chop $out; print $out, "\n";
If (as is probably the case) you have a number of these records to go through, you'll want to cycle through them once to get a full list of all possible fields, then cycle through again to output the data in the proper order.
|
|---|