I need to parse and import a .csv file to a MS SQL database. Here is a sample of the .CSV file:
So the first row contains the headers, and the next the data. The columns are always the same, they don't change from one file to the next. I need to have a program that will take the files and import them in an SQL database. The requirements are as follows:
1) There must be a table per unique symbol. In this case one for AACC, one for AAIT, one for AAME, etc. If the program sees a symbol for which a table doesn't exist, it must create the [url removed, login to view], if there already is a table for that symbol only an insert is necessary.
2) The format for each table is as follows:
CREATE TABLE [dbo].[AAPL](
[Symbol] [varchar](20) NOT NULL,
[Index] [bigint] NOT NULL,
[Open] [float] NOT NULL,
[High] [float] NOT NULL,
[Low] [float] NOT NULL,
[Close] [float] NOT NULL
) ON [PRIMARY]
3) The column INDEX is derived from Date. Here is the code I'm using now:
DateTime dt = [url removed, login to view](csv[DATEFIELD])
static int ConvertDateToBarNumber(DateTime dt)
* Defines a unique index for each minute, starting on 2000/1/1 00:00
return ([url removed, login to view] - 2000) * 525949 + [url removed, login to view] * 43829 + [url removed, login to view] * 1440 + [url removed, login to view] * 60 + [url removed, login to view];
This is basically the number of minutes elapsed since 1/1/2000
4) This should be a console application, not windows forms. I would like to specify only the folder where the .csv files are located, and the program will automatically process all .csv files in the folder. I would also like to have an option to DELETE the file after it is processed.
Hi! I am interested in your project and like to help you out. Got the .NET, MSSQL and stock trading skills to do the work. Looking forward to hear from you!
44 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön
Hi, I'd like to help you on this. It looks pretty straightforward, although I do have some minor questions that we can clarify upon bid acceptance. I look forward to working with you! regards, Johnny