A
Alexander Heimann
Hi guys. I am new to Perl(four days). I am having a blast playing with
it. There seems to be a hundred ways to solve each problem I am faced
with.
Currently I am working on migrating data to a new database. I need to
read the contents of a few thousand files and then insert the contents
into a database. The trick is the files are named desc.121655 with
121655 being the record number or primary key in the database. So I
need to parse the filename and save the extension to a variable to
later use in my SQL statement. The steps I think i need to take are
below any comments would be great
1. open directory..
2. go file by file
3 assign extension of file to a variable @recordNum
4 assign contents of file to a variable @content
5 then insert content with SQL statement where PK = @recordNum
6 then do next file until end of directory
sorry if that sounds confusing i am a bit new at this
Alex
it. There seems to be a hundred ways to solve each problem I am faced
with.
Currently I am working on migrating data to a new database. I need to
read the contents of a few thousand files and then insert the contents
into a database. The trick is the files are named desc.121655 with
121655 being the record number or primary key in the database. So I
need to parse the filename and save the extension to a variable to
later use in my SQL statement. The steps I think i need to take are
below any comments would be great
1. open directory..
2. go file by file
3 assign extension of file to a variable @recordNum
4 assign contents of file to a variable @content
5 then insert content with SQL statement where PK = @recordNum
6 then do next file until end of directory
sorry if that sounds confusing i am a bit new at this
Alex