forked from ferkulat/csv2xls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequirement.txt
61 lines (47 loc) · 2.24 KB
/
requirement.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
*Why not using Excel or any other interactive programs?*
In a use case I should import millions of records into a MSSQL data base via SSIS.
The import tool expected the input as an Excel file.
It was not allowed to access the data base directly.
This Excel file
- must not contain more than 65536 rows,
- has to have a special worksheet name,
- has to have a special name and
- should be placed into a special folder to get imported.
The millions of input records, are listed in a CSV file.
To meet the conditions for the import, following could be done:
1. Produce several CSV files with maximum 65536 lines,
2. For each CSV file do
open it with Excel,
rename the work sheet,
save as \specialpath\specialfilename.xls,
run the import tool
There is a need for an automated noninteractive procedure.
A program takes the CSV file as input and
1. converts it to one or more Excel files
2. for each Excel file:
- copy it to \specialpath\specialname.xls
- run the SSIS import tool
- write the log of import tool into a file
For step 1 a noninteractive way to convert CSV to Excel is needed.
*Requirements*
1. Take a CSV file and convert it in one or several Excel files.
1.1 CSV input file
- no row count limit
1.2 Excel output file
- row limit is 65536, but can be set by parameter
- base file name is the base name of input file, or given by paramater
- if more than one Excel file is produced, starting with the second Excel file,
the file name will be extended by a growing 3 digit number
Example: filename.xls filename001.xls filename002.xls
- by setting a parameter for head line, the first line of input file
is the first line for all produced Excel files
- all entries are in text format, no conversion to numbers, dates and so on
1.3 Noninteractive
This program is indendet to be used by a noninteracive script.
So this program has to be a console programm.
Parameters will be given by command line.
1.4 Portability
This program should be available for at least Windows and Linux.
1.5 Dependencies
MS Excel or any other properitary software must not be a dependency to run this program.
Writing and compiling the software should be possible with open source software.