paynegaz Posted January 3, 2014 Share Posted January 3, 2014 (edited) I have a process of comparing two .csv files to find where LastName, FirstName, and DOB do not match. I receive two files from our client, I merge those files with no duplicates and then I compare them by pulling last name from our database file for the day to a find feature in the .csv merged file. The goal is to find names on database not in two reports received and merged file (exception Report). This is presently done daily as has had 30 to 300+ names to compare. I would like to automate this through AutoIT. Do you have suggestions? Below is the steps in this manual process at present: Automating the HINAZ Client Report Process The present process involves many steps through several different software systems: FileZilla-download 2 notepad .csv reports from client in AM and PM of previous day into merged file Our Database-generate a report of names accessed by client employees from previous day, download as .csv or Excel report to client file Merge 2 notepad Reports 01 and 02 into merged .csv file, save as merged file Open Database report, add “Found” column, then copy last name of first patient name Open “Find” function in client Merged file Paste last name into “Find” box Review last names, manually scan for match to First name in merged file If match on Last and first name, the match to date of birth If all match, go to next name If no match, mark User Last Name, User First Name, Last name, First name, Date of Birth in yellow marker to mark for client Merged File, then go to next name. Continue through names until come to end of database list Open a client Exception Report for wexceptions.docx Change date to report date Review database report for IP Addresses, if match, then go to next IP Address, if not an IP Address match, then count, place total in IP Exceptions area of report. Count number of yellow marked names, place total in word document Copy yellow marked names into exception word report Change report completed date to today’s date File->Save as-> File Save As Type To: PDF->Archive->client Exception Report clientexceptionreportReportdate_exceptions.pdf Close client Exception Report for w/exceptions.docx->save Send secure Exceptions Report to Open Cisco Secured E-mail- Res Login Input email address Input password Open client e-mail contacts.docx Copy e-addresses to Cisco Res To: and CC: Enter “Exception Report for report date” in Subject or “Exception Report for report date-No Exceptions” if no yellow marked names. Add Attached is the “Exception Report for Report Date” or No Exceptions above” Add Thanks Add HIE Name Click Attachments, Click Browse->Achieve->input select ClientExceptions ReportReport date->click add, click done, Check information, Click Send Close Cisco RES This process many different programs, can the processes be put into macros, then tied together with AUTOIT or is there a easier, better way to do it? Edited January 3, 2014 by paynegaz Link to comment Share on other sites More sharing options...
jchd Posted January 4, 2014 Share Posted January 4, 2014 Welcome to the forum! This is a good job for AutoIt. I suggest loading all FTPed csv files into a local SQLite database, which will allow you to perform the merge and comparisons you need easily and reliably in one step. Keeping 100 years of history is no problem. UDFs exist to automate Office Word and Excel. If you decide to get wet with this, you'll find solid help here. paynegaz 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
paynegaz Posted January 10, 2014 Author Share Posted January 10, 2014 Welcome to the forum! This is a good job for AutoIt. I suggest loading all FTPed csv files into a local SQLite database, which will allow you to perform the merge and comparisons you need easily and reliably in one step. Keeping 100 years of history is no problem. UDFs exist to automate Office Word and Excel. If you decide to get wet with this, you'll find solid help here. Hi jchd: Thanks for your help! I am new to AutoIT, can you help me in getting started with this project. Where should I start? What variables to create? Can I include Excel macros into AutoIT? Thanks, paynegaz Link to comment Share on other sites More sharing options...
jchd Posted January 11, 2014 Share Posted January 11, 2014 Sorry for delay in answering. My advice for now is to start building the skeleton of your application to first learn how to use the main components you'll need. FTP, database access, generation of Word report based on a suitable template, send mail, ... For a first step it isn't bad idea to simulate actual actions you don't master in detail, by means of dummy functions returning constant strings. Once you get more proficient with the language and step by step more confident with how the building block will have to behave, then you can start replacing dummy functions by real-world ones. If you try to write everything from scratch all at once I'm afraid you're going to spend much more time and overlook a required robustness of the code structure. This of course is only true if you expect long-term regular use (implying maintenance and flexibility for future changes/needs). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
paynegaz Posted January 14, 2014 Author Share Posted January 14, 2014 (edited) Sorry for delay in answering. My advice for now is to start building the skeleton of your application to first learn how to use the main components you'll need. FTP, database access, generation of Word report based on a suitable template, send mail, ... For a first step it isn't bad idea to simulate actual actions you don't master in detail, by means of dummy functions returning constant strings. Once you get more proficient with the language and step by step more confident with how the building block will have to behave, then you can start replacing dummy functions by real-world ones. If you try to write everything from scratch all at once I'm afraid you're going to spend much more time and overlook a required robustness of the code structure. This of course is only true if you expect long-term regular use (implying maintenance and flexibility for future changes/needs). JCHD: Thanks for helping. I have reviewed the material you recommended. If I understand your answer, I should take a small portion of this project and do a dummy script. For example, I could try downloading the .csv files into SQLite. Should I do that through a macro? I attempted to run an Excel macro to record my keystrokes of downloading the files, but when I look in the Visual Basic Editor it has basic code, setting up the file, but no recorded keystrokes shown. Am I doing this incorrectly? Thanks again in advance for your help and advice. Edited January 14, 2014 by paynegaz Link to comment Share on other sites More sharing options...
jchd Posted January 14, 2014 Share Posted January 14, 2014 Divide and conquer is always a pretty good strategy. First use embedded FTP support to fetch the .csv data files. Then use ADO (ODBC) support to grab data from your database, bypassing the creation and processing of yet another .csv. Probably the easiest way to merge and filter the various datasets is to insert everything in a single local SQLite DB which you can query as needed. The Word UDF will help you create the final report. emailing that to the client will complete the job. You should find all the building blocks in standard UDFs which come with AutoIt, and some other UDFs you can find in Example Scripts forum. Remember that the less you depend on external programs to achieve your goal, the less maintainance you'll have to do. Recording keystrokes to have Excel massage your data will reveal more fragile than processing it yourself. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now