window command prompt for searching - command

When you use window and go to a folder, there will be a search box and when you write something there, windows will automatically search the folder and all subfolders inside it for the keyword (it searches the title and the content of all documents also).
I just wonder if there is a way to perform that similar action but in command prompt (I want to search all types of file: pdf, txt,...)
I have tried find and findstr but findstr only searches text file and for find it returns wrong result for me. Because I know for sure that for example the word 'dangerous' is in a document but the result from find is 0

Do you want it to search the filenames for the keyword or the actual contents of the file? In such case i think you will need to write a simple c++ program to stream the data of each file and search for the keyword that way

Related

Powershell search for pattern with itextsharp.dll

I need to search pdf-files for patterns and then I just want the name of the files containing "region värmland", using that to copy the files to a different folder.
The pattern is in the top right corner, and if possible I would like to search as little as possible in the file due the number of files.
I could not find any relevant information when googleing how to just search for one set of words and keep the output inside the script for further use.
Anyone who can help with this?

Find or replace a string in word documents in a given folder

How to find or replace a word in the documents in the given folder
Is there is a tool or any script is available to do that?
Thanks.
Finding text is straightforward. There are several ways to do it, including using the Windows search utility. Here's an article with several methods: Search through the content of multiple Word documents
To find and replace, you can use a free text editor like Notepad++. It has a very good Find in Files utility. There are many other utilities that can do this, some paid and some free.
Finally, you can write a VBA macro that will find and replace all documents in a folder. Here's a page with a macro listing that does that: How to Find and Replace Contents in Multiple Word Documents

Command prompt for merging word documents

I have two word documents and I need to merge them into one word document using command prompt. Option copy *.extension newfile.extensions works with .txt or .csv file but if I do that with docx result of operation is corrupted word file.
You won't be able to achieve what you want (with command copy) as merging two word documents is a bit more subtle than just do a 'bit wise append' (which is what the copy command does).
Google give quite a few result when searching for 'merge word documents'. One of the result might point you to a tool that you can invoke at the command line.
Hope this helps.
I have need of something similar, and this was the best I could find: https://github.com/jamessantiago/DocxMerge
I haven't tried it yet, but from all I can tell there is no command line option for combining Word documents.
(Good to know: The .docx file is actually a zip file. Rename it to .zip and unzip it to view what's inside. Combining two documents is tricky, but obviously possible, from command line. But there is no built-in command to do it.)

How to append 2 word documents into 1 using the command line (no vba)

I'm trying to find a simple solution to append 2 MSWord files into one using Windows 7 command line /batch file only (no vba).
I already tried
copy /B /Y file1.doc+file2.doc=file3.doc
but file3.doc only gets the contents of file1.doc, but not file2.doc.
Copy works just fine with text documents, but is not working for me on MSWord documents.
Any ideas on how I can accomplish that from the command line?
If doing that in a vb script is simple, I might do it in vb and forget about my batch file approach.
You can concatenate text files via copy, because the files contain just text without additional structural information. That does not apply to Word documents, though. I'm afraid what you want cannot be done without resorting to VBA.

Eclipse find all in one file

In Eclipse (CDT), is there a way to find all occurrences of a string in a single file? I can search the entire workspace easily enough using Ctrl-H, and can do "find-next" using Ctrl-F, but I want to be able to see a list of all matches for just one file.
It would be possible to do by setting up a custom file filter for each file I want to search, but that's very clunky. Eclipse should be able to work out which file I have open and just search that file.
This seems like it should be easy, but I can't find an appropriate option...does it exist?
Use CTRL+H and switch to File Search as you already mentioned, but set Scope to Selected resources. Now you can either search the current file, or selected multiple files and search all of them