Search From A File

  • Hello:


    I need to search for values from my excel spreadsheet row A ('Picture #') in a folder on my C:, with a match from the spreadsheet in the file name of the folder I am searching, I need the matching file copied down to a different file. Also, I would like it to keep a record of error searches. So I separate tab on the spreadsheet being searched from to show which of the values from row A were not found.


    Can anyone help me with performing these actions, either through macro or VB or what ever...


    Thank you,


    ~john

  • Re: Search From A File


    JohnRW,


    I'm guessing that you haven't explained the problem well enough to get the help. Can you post a small sample with the expected results?


    Jim

  • Re: Search From A File


    Hello,


    Thanks for the quick reply. I’ve attached a copy which shows how the spreadsheet will look. The issue is I have about 25 cds which have images of the front and back of checks which have processed. They are named using the same convention as is shown in my column A of the “Example Spread Sheet”. I need a way to search from the numbers in Column A from a folder I’ll copy all of the cd’s images into, then I would like the script or macro to copy the file I just searched into another folder which I can print.


    This keeps me from individually searching each row from the spreadsheet and matching it up with one of the files and manually printing them. I need to do this for a random selection of 300 checks out of the many files stored on the CD. Is this more clear?


    Thank you,


    ~John

  • Re: Search From A File


    JohnRW,


    It's getting more clear but still is quite muddy. Let's see what I got so far and you can add to the list...


    1) The CD images will be named and stored in files.
    2) The list of Voucher Numbers in column A of you spreadsheet will exist in one of the files containing the names of the images.
    3) You want to search the files listing the images for a match.
    4) When you find a match...


    What kind of files will the images be stored in?
    What is the layout of the files?
    Where will the Voucher Numbers appear in the files?
    What happens after you find a match?


    Jim

  • Re: Search From A File


    Jim


    1) The CD images will be named and stored in files. (I will pull all the files (images) from the CDs and place them into one file on my PC)
    2) The list of Voucher Numbers in column A of you spreadsheet will exist in one of the files containing the names of the images. (the image names which will be all on my PC are named by voucher number)
    3) You want to search the files listing the images for a match. (I want to search from the file of images using each row in column A of the spreadsheet)
    4) When you find a match ( to copy the matched file and place it in a new folder. )


    Having all of matching files (or voucher images) in a new folder, and having the search pull the files automatically will keep me from having to manually searching for. Next I’ll be able to print the images within the folder the processes created so that I can run the process and forget about it, once it is complete I can print the files it found. One trick is, this is for an audit of sorts, so the column A of the spreadsheet is required to be audited and I must provide the records, if it misses one Id like an error report to tell me.


    Thank you,


    ~John

  • Re: Search From A File


    JohnRW,


    Ok. Let's see what we have now.


    1) The CD images will be stored in one file - lets call it "IMFILE".
    2) The IMFILE will contain a list of names that correspond to the voucher number in column A of your Excel file.
    3) The IMFILE will NOT contain anything else but a list of names.
    4) You want to search the IMFILE for voucher numbers that appear in your Excel file.
    5) You want to do something if there is a match.


    What kind of files will the IMFILE be?
    What is the layout of the IMFILE?
    Where will the Voucher Numbers appear in the IMFILE?
    What happens after you find a match?


    Jim

  • Re: Search From A File


    What kind of files will the IMFILE be?
    What is the layout of the IMFILE?
    Where will the Voucher Numbers appear in the IMFILE?
    What happens after you find a match?


    The files are within a windows folder and are all .TIF files. The files open to a scan of a check. File naming convention is as follows, XXXXXXXXXX-YYYYYY, the leading 10 (X) digits are the voucher name from Column A in the SS. With a match found they should be copied into a new location so that I can print the entire location.


    Thanks!

  • Re: Search From A File


    JohnRW,


    You're making this veeerrrryyyy difficult. Answer each and every question carefully. Read the last post again. Check all my statements for accuracy. Answer all my questions. Post again.


    I'm trying to clear this up enough to get you some help but, you are not making it easy.


    Jim

  • Re: Search From A File


    1) The CD images will be stored in one file - lets call it "IMFILE". OK sounds great to me, from this point forward I’ll refer to it that way.



    2) The IMFILE will contain a list of names that correspond to the voucher number in column A of your Excel file. Yes, close. IMFLIE contains files which are named in the following format, XXXXXXXXXX-yyyyyy. The XXXXXXXXXX first 10 digits (x’s) are the same digits which will be in column A.


    3) The IMFILE will NOT contain anything else but a list of names. The IMFILE will contain a is a file of Images named by voucher number. As you stated in ‘1)’ “The CD images will be stored in one file’.


    4) You want to search the IMFILE for voucher numbers that appear in your Excel file. Yes, I need to find the files which correspond with the records stored in the spreadsheets column A.


    5) You want to do something if there is a match. Yes, I want to copy the image files which match into another file which will contain only the files which were found to match up with a record in Column A of the spreadsheet.


    6) What kind of files will the IMFILE be? What is the layout of the IMFILE? The files are within a windows folder and are all .TIF type image files.


    7) Where will the Voucher Numbers appear in the IMFILE? The IMFILE names are XXXXXXXXXX-yyyyyy (as discussed above) The first 10 digits XXXXXXXXXX match the spreadsheet column A voucher names which are being searched for.


    What happens after you find a match? With a match found they should be copied into a new location so that I can print the entire location.

  • Re: Search From A File


    JohnRW,


    More progress... let's see if we can clarify a little bit more.


    1) The CD images will be stored in a Windows folder named "IMFILES".
    2) The image files will be named XXXXXXXXXX-yyyyyy.TIF.
    3) The XXs in the file names will correspond to the voucher number in column A of your spreadsheet.
    4) When there is a match between the voucher number in column A and one of the filenames in the folder IMFILES, you want to copy the matching image file to another Windows folder named "IMFILEMATCH".
    5) You want to use another program, not Excel, to print the files in the folder IMFILEMATCH.
    6) If you don't find one of the voucher numbers in the folder IMFILES, you want an error log printed on an Excel sheet for review later.


    Jim

  • Re: Search From A File


    1) The CD images will be stored in a Windows folder named "IMFILES". Correct!


    2) The image files will be named XXXXXXXXXX-yyyyyy.TIF. Correct!


    3) The XXs in the file names will correspond to the voucher number in column A of your spreadsheet. Correct!


    4) When there is a match between the voucher number in column A and one of the filenames in the folder IMFILES, you want to copy the matching image file to another Windows folder named "IMFILEMATCH". Correct!


    5) You want to use another program, not Excel, to print the files in the folder IMFILEMATCH. Close! I’ll just go into the folder and print it on my own, I am just looking for the tool to do most of the leg work in, searching, and copying in a new folder.


    6) If you don't find one of the voucher numbers in the folder IMFILES, you want an error log printed on an Excel sheet for review later. Correct!


    I apologize for my inability to clearly state my issue, thank you very much for patiently fighting through it with me!


    ~John

  • Re: Search From A File


    JohnRW,


    You're welcome. Here's what you need then.


    A macro that will:


    1) Search a folder for filenames that match a list in an Excel workbook.
    2) Move the files that match to another folder.
    3) Write an error log to another sheet in the workbook when there is no match.


    Start by searching the forum for the following terms.
    1) Search a folder
    2) Move files
    3) List files
    4) Anything that shows as a related topic when you read something from the search results.


    If you still can't find anything, start another thread using the three items for the macro as the requirements and a suitable title.


    Jim

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!