If you are using IS6.0 and above versions then try this scenario,
Configure a filepolling port that will poll the specified folder and it will grab those files and process it to a FlowService as a InputStream object (ffdata)and flow service logic will be
bytesToString (file content)and then persist the content in the DB as per your requrirement.
So once this process successfully completes then the filepolling port can move this file to another folder that you have mentioned in the Archive folder (filepolling port settings).
If the flowservice done with errors then the file will be moved to Error directory that you have mentioned in the Error folder (filepolling port settings)
If IS4.6 then write javaservices to readFile that does polling files,moveFile or use PSUtilities package services that will provide the listofFiles in the specified folder and using pub.file:getFile service read the files onebyone and persist the content in DB and use moveFile javaservice that moves to another folder.