print txt files pages which contain Word

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kkshansid
    New Member
    • Oct 2008
    • 232

    print txt files pages which contain Word

    ours is very much printing Work We print txt files of about 50000 pages daily.After these printing We have to again print more than 1000 different page based on certain Word because there printing Was of bad quality.for example they order me to again print those page which contain Word eg. gold or form or pgno5 or pgno62.....etc .About 1000 reprint.I have to find those page manually by find option of notepad and cut them and paste in another file.the process take about 1000 find,1000 copy and 1000 paste.this takes very much time.Is there any easy method in any language to do that?i Will be very thank full to you
  • RhysW
    New Member
    • Mar 2012
    • 70

    #2
    Yes, with a bit of effort this could be achieved, a theoretical method for achieving this would be to have each file you want to sort through in a list, through this list a streamreader or other form of file.io would be able to read each document, a simple find function would be able to determine if it contains the searched word, if it does then that document should be automatically entered into another list called print list or something, once every file has been iterated through looking for the word you gave it you would be able to run a loop where each file in the list of things to print would be printed, then boom you have yourself a piece of software which will search for a word you ive it, find the files and print the files and all you have to do is type the word and press go!
    so yes it is possibble but i dont have the time to write that piece of software currently, im just providing the theory perhaps for someone who has the time but didnt know where to begin

    EDIT: Actually just found this link, it nearly does what you want it to do, the answer by Henk Holterman has some crossed out lines but you need those, and isntead of deleting the file, just have it print instead! very little modification needed and you have yourself a useful little app!
    I need to check a directory to see if there are any files whose file name contains a specific keyword and if there are, to delete them. Is this possible? For example, delete all existing files in...
    Last edited by RhysW; Apr 13 '12, 11:26 AM. Reason: Added a useful link to something which nearly does the entire process

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      It would probably help if we had some idea what tools you have available. For example do you have a programming language of any sort that you could use to throw together a quick utility?

      Also, is this one huge 50,000-page text file or 50,000 individual ones or what? If they're individual files you could use the Windows file-search tool to find all the ones containing your word, then do a bulk print of those files from the "search results" folder.

      Comment

      • RhysW
        New Member
        • Mar 2012
        • 70

        #4
        almost got this done, you type in a word and press go, it searches through a folder containing each file, if it contains that word anywhere in the document it moves it to a results folder, (which is excluded from the search to avoid infinite loops) from there you can just do a bulk print like suggested above

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          That's what the built-in Windows search facility does. As far as I can see, the only reason to write such a utility is "because I can" (which is a damn good reason, of course).

          The details might be slightly different if you're actually moving the documents, as stated. Windows search just temporarily creates shortcuts to them.

          Comment

          • RhysW
            New Member
            • Mar 2012
            • 70

            #6
            windows search doesnt check the contents of each file, just its name when you do a search doesnt it?

            Comment

            Working...