Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
giakoum
Partner - Master II
Partner - Master II

Export chart to delimited file using any delimiter and removing headers

Hi all.

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.

Features :

- File name

- File Type (txt and csv have been tested)

- Output directory

- Delimiter

- 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;

Looking forward to your suggestions!

Thank you.

Giakoumakis Ioannis.

1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II
Author

Well, either the application is so perfect that there is nothing to comment about or it is so terrible that it is not worth commenting...

View solution in original post

2 Replies
giakoum
Partner - Master II
Partner - Master II
Author

Well, either the application is so perfect that there is nothing to comment about or it is so terrible that it is not worth commenting...

abm_trevor
Partner - Contributor II
Partner - Contributor II

Works like a charm, thanks Ioannis.  I was previously doing this though a QlikView export then a separate batch script to remove the headers. This is much more elegant.