Posts Tagged mymaillist deluxe

LogParser v2.2 Output to MySQL

There are multitudes of reasons why you should backup your data to a trustworthy location. Went back to office this afternoon, realised that the files on the server was being deleted; thus causing the script to malfunction, infact the main script was deleted. Anyway, i had to recode from scratch. sigh.

The company is running a standalone MyMailList Deluxe software for years, and they need to merge the datas on the software with the internal application i created for the company. Not everything is automated, the administrator still has to export the CSV file manually to the proper designated folder that propagates the data into database.

Here goes my codes for those who needs it.

———————————————————–

@echo off
echo **************************
echo * Author: John Goh, byon@testaccelerator.com
echo * Date: Oct 06, 2009
echo * Description:
echo * Allows internal application to retrieve latest
echo * company mailinglist information
echo *
echo * Remember to save ExpFile.csv in C:\
echo *
echo * Pre-requisite for server setup,
echo * – install LogParser 2.2, MySQL ODBC 5.1 Driver, MySQL Server 5.0
echo * – Setup ODBC DSN to: mailListDSN under Control Panel (WinXP/2K3)
echo * – Scheduled Tasks this Script Daily
echo * – Put this script in a important directory D:\Applications\
echo * – Remember to do daily backups to this file
echo * – Setup LogParser in the ENVIRONMENTAL PATH VARIABLE
echo *
echo **************************

logparser “SELECT [Acct Start], [Address1], [Address2], [Attn], [Business], [Check Digit], [Company], [Credit], [Custom1], [Custom10], [Custom11], [Custom12], [Custom2], [Custom3], [Custom4], [Custom5], [Custom6], [Custom7], [Custom8], [Custom9], [Special Instructions] AS [SpecialInstructions]  FROM C:\ExpFile.csv TO maillist WHERE NOT Company = ”” -i:CSV -o:SQL -server:localhost -database:courier -username:root -dsn:mailListDSN -driver:”MySQL ODBC 5.1 Driver” -cleartable:ON -createtable:ON

———————————————————–

Save it as query.bat and run it off Command Prompt, or Schedule Task it!

Leave a Comment