0

I'm new in my development role, I have to automatically pick up multiple files in specific format once per week from the FTP folder.

The file names are in this format:

PODLM_10011548501_PTY002323_8569865954.tiff
PODLM_10011548502_PTY002324_8569865955.tiff

After picking them up, I need to save the filename info into an existing SQL table called order as follows:

Order table:

id   CodeNumber     PPNumber    ClientID     
1    10011548501    PTY002323   8569865954
2    10011548502    PTY002324   8569865955

Any advice or solution will be appreciated

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Mathembi
  • 17
  • 1
  • 5
  • 3
    Welcome to stackoverflow - please read [How to ask](http://stackoverflow.com/help/How-to-ask). We dont really do "how do I" we do "I wrote this and cant see why it doesnt work" .. You need to tell us, what you tried - google has many examples of nearly everything – BugFinder Jun 30 '16 at 09:11
  • This is a large task and it will be best to divide this question into a few small questions, first part how to read files from ftp, later on how to insert content to sql. – Offir Jun 30 '16 at 09:11
  • for monitoring files http://stackoverflow.com/questions/15017506/using-filesystemwatcher-to-monitor-a-directory – lordkain Jun 30 '16 at 09:15
  • and sql http://stackoverflow.com/questions/12241084/how-to-insert-data-into-sql-server maybe better to use EF – lordkain Jun 30 '16 at 09:16
  • Even asking `How do I write something into a database` is not considered a good question. Show what you have tried, the error you are getting. `How do I` or `Where is a tutorial` are questions typically answered by Google – Sascha Jun 30 '16 at 09:17
  • Which RDBMS is this for? Please add a tag to specify whether you're using `mysql`, `postgresql`, `sql-server`, `oracle` or `db2` - or something else entirely. – marc_s Jun 30 '16 at 10:08

2 Answers2

2

I suggest you to split this question into 4 small questions:

Read files from ftp?

Create a weekly task?

Split a string and save it in a model?

Save a model in sql data base?

Google these questions and you will be in your way to accomplish the mission,

Good luck.

Offir
  • 3,252
  • 3
  • 41
  • 73
0

What we've done in the past is to create small app, can be a console app that reads the folder in question. Makes no difference if it is an ftp folder or what the file type is. You determine that. In that same app you can connect to you DB and then save any info you need.

Then using MS scheduler you can create a schedule to schedule your app to run once a week, or at any interval you choose