Export chart to delimited file using any delimiter and removing headers
I have created a macro that exports a chart to a delimited (txt or csv) file. The Developer can decide which delimiter to use, what file name and how many header rows to omit.
- File name
- File Type (txt and csv have been tested)
- Output directory
- Number of header rows to remove
The macro actually exports the chart to a file (with headers), let's call it File1, using the desired delimiter. Then it starts reading through File1, first skipping any header lines, and then each read line is written to File2. Once this is competed, File1 is deleted and File2 is the desired output.
Reading from File1 and writing to File2 line by line, brings up a performance issue. It took approximately 10 minutes on my laptop, to browse through 1 million lines and 4 fields. Not bad, but I think that there must be a way to improve this.
So please feel free to comment, change and improve the attached QVW so that it performs better. Currently it has 10000 lines of data, but this can easily be changed in the script (reload needed after any change): LET vLimit = 10000;