AutoHotkey v1.1 (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+ (http://www.autohotkey.com/)
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)
1.0.00 2022-07-18 (summary of changes in beta v0.5.10 to v0.5.15) New function ObjCSV_BuildMergeField allowing to copy
or combine existing fields in a new field; new function ObjCSV_MergeSpecsError to validate merge specs syntax;
merge fields support in ObjCSV_Collection2CSV, ObjCSV_CSV2Collection and ObjCSV_ReturnDSVObjectArray;
support merged specs in file header and in strFieldNames. Note: changes in v1.0.00 are backward compatible.
0.5.15 BETA 2022-04-15 Support merged field when passing merge specs in strFieldNames instead of the file header.
0.5.14 BETA 2022-04-04 Rename functions, parameters and variables from "reuse" to "merge": ObjCSV_MergeSpecsError,
ObjCSV_BuildMergeField. Remove unused parameter objHeader from ObjCSV_BuildMergeField.
0.5.13 BETA 2022-03-28 Add function ObjCSV_ReuseSpecsError to validate reuse specs syntax, return ErrorLevel if error in
ObjCSV_Collection2CSV and ObjCSV_Collection2Fixed, add row number parameter to ObjCSV_BuildReuseField for placeholder ROWNUMBER.
0.5.12 BETA 2022-02-28 Simplify reuse specs; add function ObjCSV_BuildReuseField, reuse fields support to ObjCSV_Collection2CSV
and ObjCSV_Collection2Fixed (reuse fields are not supported in ObjCSV_Collection2HTML and ObjCSV_Collection2XML).
0.5.11 BETA 2022-02-24 Add reuse fields support to ObjCSV_CSV2Collection and ObjCSV_ReturnDSVObjectArray; reverse changes in
ObjCSV_Collection2CSV now covered by ObjCSV_ReturnDSVObjectArray.
0.5.10 BETA 2022-02-09 In ObjCSV_Collection2CSV, add strReuseDelimiters parameter allowing to specify to copy or combine
existing fields in strFieldOrder.
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