Newbies VickiH Posted April 10, 2007 Newbies Posted April 10, 2007 I'm working on a project where I need to drop a text file into a folder, have it automatically save the filename, open our FileMaker 6 database on our server, find the corresponding record that matches the filename and run scripts to import that file... then move the text file to a different folder. I'm having to accomplish this using a pc w/Windows Server 2003 SE (yuck). I'm not having trouble with the scripts in FileMaker, but I don't know where to begin to automate the folders on a pc. Can someone send me in the right direction of the how's and what to use? Thanks!
MarkWilson Posted April 10, 2007 Posted April 10, 2007 Welcome to the Forums, VickiH. A couple questions to clarify: Is the text file coming out of another application or is it dropped in by a user? Why is the server not already open? Are there any access/security issues that a batch file may encounter? Is this script only to be run on Windows machines or triggered from a Mac? What is the file name and extension? How does the file name match the record in the database? Import the file, import the contents of the file, or link to the file in a new location? Please add any more details to clarify the intent of this request.
SteveB Posted April 10, 2007 Posted April 10, 2007 One way to do what you want is to use WinBatch which is a great automation tool. See WinBatch It's truly a Swiss Army Knife, and is easier than writing in VB. Steve
Newbies VickiH Posted April 11, 2007 Author Newbies Posted April 11, 2007 Thanks Mark! In answer to your questions... The text file will be named and dropped in by a user. That is the only human interaction wanted. Server can already be open, but I need a script to be triggered when the file is dropped. No access/security issues that I'm aware of. Script will be triggered from a designated Windows machine, but databases reside on a mac server. Filename and extension example: 13567.txt First 5 numbers make up the single matching field in the database. Import the file, which will create 270 records, allowing me to save the calculated results I need from those records. Then I need the text file moved to another designated folder, which will contain all the text files once they're imported and complete. Actually, now that I think about it, as long as it can automatically save the name of the current dropped file, match and import it, they don't need to be moved. Any help is much appreciated since I'm hoping to accomplish this by the end of this week...
Newbies VickiH Posted April 11, 2007 Author Newbies Posted April 11, 2007 Thanks Steve, I'll check out WinBatch too!
MarkWilson Posted April 11, 2007 Posted April 11, 2007 The (limited) manual process to achieve this is: Send Message to create a text file of the folder's directory. Pause 2-3 seconds Import the new text file and compare the contents against the old text file records. Isolate a new record. Send Message to rename the file to "dir.txt." Import "dir.txt." Send Message to rename "dir.txt" to the original value. Send Message to move the file to a new location, if desired. Move and modify the data in FM as desired. You will want two files for this. One for the directory/file handling and one for the imported data. Also, I left out the looping, pauses, and error capturing need to make this work. To create the text file containing the directory contents. "cmd /c dir C:Folder /b /o:n >C:Folderdir.txt To rename the text file. "cmd /c rename C:Folder" & record_number & ".txt C:Folderdir.txt" To move a file. "cmd /c move C:Folder" & record_number & ".txt C:NewFolder" or Use the WinBatch plug-in.
Recommended Posts
This topic is 6478 days old. Please don't post here. Open a new topic instead.
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