A script program is required to insert a first data row to financial instrument data. The output of a charting program produces many .csv files in the following format:
03/01/2006 3.32 3.32 3.24 3.25 71600000
04/01/2006 3.28 3.29 3.25 3.28 45300000
...
Each file typically contains hundreds of data rows and there may be over a hundred files to be processed. Sample data for development/testing will be provided.
The script should add the following header row to each file:
Date O H L C Volume
So that the resulting file looks like:
Date O H L C Volume
03/01/2006 3.32 3.32 3.24 3.25 71600000
04/01/2006 3.28 3.29 3.25 3.28 45300000
...
Usage
1. It must be possible to run the script on a single file from the command line, e.g. <script_name> <file_name>
2. It must be possible to process a set of files in a folder, e.g. <script_name> <path_name><file_name> (including a wildcard, e.g. *.csv)
3. Sometimes, the Volume column is not present in the source data. In this case only Date, O, H, L, and C column headings should be written
4. Sometimes, only some of the files are new, so if a header row already exists, the source file should remain untouched
Notes
1. The script will be run on a Vista machine,
2. It is presumed the script will be developed in WSH (negotiable, but don’t want complex installation pre-requisites)