= DrawMGT Data Migration and Configuration Tools = <> = Message Catalog Merging = Use the tool: '''lib/etc/mergeMessageCatalog.pl''' This replaces all messages in a specific language in a message catalog file. Example: In this case the Message-ABT.txt file is a new file with new French messages in it. {{{ cd app/config ../../lib/etc/mergeMessageCatalog.pl -c Messages.txt -l fr_FR Message-ABT.txt > Messages-New.txt diff Messages.txt Messages-New.txt }}} = CSV File Parsing = == CSV Parse Perl Module == 1. CSV and tab-separated files created by Excel can have carriage returns in individual cells. 1. There is a perl module: CSV, which is able to parse this. * [[http://rath.ca/Misc/Perl_CSV|rath.ca/Misc/Perl_CSV]] - Description and instructions * [[http://rath.ca/Misc/Perl_CSV/CSV-2.0.html|rath.ca/Misc/Perl_CSV/CSV-2.0.html]] - Perl documentation for the module * [[http://rath.ca/Misc/Perl_CSV/CSV-2.0.tar.gz|rath.ca/Misc/Perl_CSV/CSV-2.0.tar.gz]] - Source file 1. Installation of the module: As root on a Unix/Linux system: {{{ cd /tmp tar xvf CSV-2.tar perl Makefile.PL make make test make install }}} 1. Test to make sure it works: The following could should '''not''' output any error messages: {{{ perl -e 'use CSV;' }}} = DrawMGT Tool genComment.pl = 1. '''app/etc/genComment.pl''' could be used as a basis for generating SQL statements from .txt files. 1. Currently hard coded to generate comment records based on a template (expressed in Perl) that gives default values for the Comments records. 1. Reads (via the -r option) the PHP instance and site settings to get the system database name and password. 1. Reads reference data tables from the database (subroutine '''getUserInitialsMap''')