Tapatalk

copy & paste from 1 doc to another

copy & paste from 1 doc to another

2

    Jan 20, 2006#1

    I'm trying to do a search through many files for some text, then copy the text into another doc.
    what I've tried is something like InsertMode
    ColumnModeOff
    HexOff
    UnixReOff
    FindInFiles Recursive Log "W:\webs\Greenbase\files\" "*.ppt;*.doc;*.xls" "my private"
    FindInFiles Log "W:\webs\test\files\" "*.ppt;*.doc;*.xls" "my confidential"
    Top
    SelectToBottom
    StartSelect
    Key Ctrl+END
    Copy
    Open "F:\webs\serverReports\greenbaseDocs.txt"
    Top
    SelectToBottom
    StartSelect
    Key Ctrl+END
    Paste

    but I don't seem to know how to select one of several docs to do the copy and/or paste.
    I'm a scripting newbe so please excuse my simple type of question.

    6,685587
    Grand MasterGrand Master
    6,685587

      Re: copy & paste from 1 doc to another

      Jan 20, 2006#2

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      FindInFiles Recursive Log "W:\webs\Greenbase\files\" "*.ppt;*.doc;*.xls" "my private"
      FindInFiles Log "W:\webs\test\files\" "*.ppt;*.doc;*.xls" "my confidential"
      SaveAs "F:\webs\serverReports\greenbaseDocs.txt"

      should be enough. But you should take into consideration some important things:

      1) Microsoft Office files are binary files and not text files.

      2) Often the text is stored by the office applications in Unicode and not in ASCII, especially if the text is in a text box.

      3) FindInFiles is designed for search on ASCII text files and not on binary or Unicode files. If it founds the string it results the file name with the full path, the line number (of a binary file???) and the line where the string was found (line of a binary file???).

      I don't know what you really want. Do you only want a list of files, which contains the 2 phrases or do you really want the text around the 2 phrases. However, the searches will not securely report really all office files and the "lines" which contain this 2 phrases.

      You could use the tool Strings from SysInternals to extract from the Office files all ASCII and in a second run all Unicode strings with a specified minimum length to a plain text file and then analyze the text files.

      If you only want a file list, use the search feature of Total Commander which can also search Unicode text in files and returns a list of files where the search string was found.

      2

        Jan 20, 2006#3

        Thank you for your response. :D
        is there a switch so that a prompt is not shown to overwrite the file involved. I'd like to run this as a batch file and no one will be available to answer prompts.
        I have found that in our case that ultraedit is very good at finding the text strings involved, perhaps because they happen to be encoded as part of a footer in the docs. the main thing is that we get thousands of docs that are uploaded and some may be sensitive in one way or another. these docs should either be mived to a more secure location or removed entirely.

        6,685587
        Grand MasterGrand Master
        6,685587

          Jan 23, 2006#4

          Try this one. It opens the file where the results of the 2 searches should be saved and overwrites the content by the new search result.

          InsertMode
          ColumnModeOff
          HexOff
          UnixReOff
          FindInFiles Recursive Log "W:\webs\Greenbase\files\" "*.ppt;*.doc;*.xls" "my private"
          FindInFiles Log "W:\webs\test\files\" "*.ppt;*.doc;*.xls" "my confidential"
          SelectAll
          Clipboard 9
          Copy
          CloseFile NoSave
          Open "F:\webs\serverReports\greenbaseDocs.txt"
          SelectAll
          Paste
          ClearClipboard
          Clipboard 0
          CloseFile Save
          Best regards from an UC/UE/UES for Windows user from Austria