ObjCSV Library - Version v0.5.9 (2017-07-20) - by By Jean Lalonde

AutoHotkey_L (AHK) functions to load from CSV files, sort, display and save collections of records using the Object data type.

For more info on CSV files, see http://en.wikipedia.org/wiki/Comma-separated_values.

Written by Jean Lalonde (JnLlnd on AHK forum) using AutoHotkey_L v1.1.09.03+ (http://l.autohotkey.net/)



Copy this script in a file named ObjCSV.ahk and save this file in one of these \Lib folders:

You can use the functions in this library by calling ObjCSV_FunctionName (no #Include required)


0.5.9 2017-07-20 In ObjCSV_CSV2Collection, reverse change in v0.4.1 to import non-standard CSV files created by XL causing issue (stripping "=") in encapsulated fields with containing "...=""..."
0.5.8 2016-12-22 In ObjCSV_CSV2Collection, fix bug when creating "C" names header if blnHeader is false (0) and strFieldNames is empty.
0.5.7 2016-12-20 In ObjCSV_CSV2Collection, if blnHeader is false (0) and strFieldNames is empty, strFieldNames returns the "C" field names created by the function.
0.5.6 2016-10-20 Stop trimming data value read from CSV file. Addition of blnTrim parameter to ObjCSV_ReturnDSVObjectArray (true by default for backward compatibility).
0.5.5 2016-08-28 Optional parameter strEol to ObjCSV_Collection2CSV and ObjCSV_Collection2Fixed now empty by default. If not provided, end-of-lines character(s) are detected in value to replace. The first end-of-lines character(s) found is used for remaining fields and records.
0.5.4 2016-08-23 Add optional parameter strEol to ObjCSV_Collection2CSV and ObjCSV_Collection2Fixed to set end-of-line character(s) in fields when line-breaks are replaced.
0.5.3 2016-08-21 Fix bug with blnAlwaysEncapsulate in ObjCSV_Collection2CSV.
0.5.2 2016-07-24 Add an option to ObjCSV_Collection2CSV and blnAlwaysEncapsulate functions to force encapsulation of all values.
0.5.1 2016-06-06 In ObjCSV_CSV2Collection if the ByRef parameter is empty, the file encoding is returned only for UTF-8 or UTF-16 encoded files (no BOM) because other types (ANSI or UTF-n-RAW) files cannot be differentiated by the AHK engine.
0.5.0 2016-05-23 Addition of file encoding optional parameter to ObjCSV_CSV2Collection, ObjCSV_Collection2CSV, ObjCSV_Collection2Fixed, ObjCSV_Collection2HTML and ObjCSV_Collection2XML. In ObjCSV_CSV2Collection if the ByRef parameter is empty, it is returned with the detected file encoding.
0.4.1 2014-03-05 Import files with equal sign before opening field encasulator to indicate text data or formula not to be interpreted as numeric when imported by XL (eg. ...;="12345";...). This is an XL-only CSV feature, not a standard CSV feature.
0.4.0 2013-12-29 Improved file system error handling (upgrade recommended). Compatibility breaker: review ErrorLevel codes only.
0.3.2 2013-11-27 Check presence of ROWS delimiters in HTML export template
0.3.1 2013-10-10 Fix ProgressStop missing bug, fix numeric column names bug
0.3.0 2013-10-07 Removed strRecordDelimiter, strOmitChars and strEndOfLine parameters. Replaced by `r`n (CR-LF). Compatibility breaker. Review functions calls for ObjCSV_CSV2Collection, ObjCSV_Collection2CSV, ObjCSV_Collection2Fixed, ObjCSV_Collection2HTML, ObjCSV_Collection2XML, ObjCSV_Format4CSV and ObjCSV_ReturnDSVObjectArray
0.2.8 2013-10-06 Fix bug in progress start and stop
0.2.7 2013-10-06 Memory management optimization and introduction of ErrorLevel results
0.2.6 2013-09-29 Display progress using Progress bar or Status bar, customize progress messages, doc converted to GenDocs 3.0
0.2.5 2013-09-26 Optimize large variables management in save functions (2CSV, 2Fixed, 2HTML and 2XML), optimize progress bars refresh rates
0.2.4 2013-09-25 Fix a bug adding progress bar in ObjCSV_ListView2Collection
0.2.3 2013-09-20 Fix a bug when importing files with duplicate field names, reformating long lines of code
0.2.2 2013-09-15 Export to fixed-width (ObjCSV_Collection2Fixed), HTML (ObjCSV_Collection2HTML) and XML (ObjCSV_Collection2XML)
0.1.3 2013-09-08 Multi-line replacement character at load time in ObjCSV_CSV2Collection
0.1.2 2013-09-05 Standardize boolean parameters to 0/1 (not True/False) and without double-quotes
0.1.1 2013-08-26 First release

Table of Contents