Search bulk files list - file

I need your help with this problem that I believe it could be solved with a batch file in powershell, I hope to be clear enough with my explanation.
I have a txt file (list.txt). In this file I have a list of more then hundred files name (company.doc, goods.xlx, prices.xls and so on).
Now I should search if these files are in disk L and the search result written a file named search.txt in this way:
company.doc FOUND L:\documents\december
goods.xls NOT FOUND
prices.xls FOUND L:\budget\2022
Thank you in advance for your help
MM
I tried to search a solution but I could not find any working.

Related

How to differentiate .odt and .docx file apart from magic number and extension

I need to detect the document type of the given file. I did it using magic numbers for pdf,RTF, doc files. but whenever I tried to do the same on odt and docx files, unfortunately, I can't because the magic number for both are same. Please help me to sort this issue. I need the answer programmatically in java
Thanks in advance.
What I just tried now :
$ file file.docx
file.docx: Microsoft OOXML
$ file file.odt
file.odt: OpenDocument Text

How do i edit a .dat file?

i have a game that i play, and i want to edit the .dat files in that game to make a difference in the game. My question is how do i do this?
I have tried multiple things but i can't figure out how to make it work. I also have a couple of other files that have .ddf extentions. if anyone can help me i would appreciate it!
I have tried the following:
decode the .dat (Couldn't find out how)
The fact that this file is a .dat file extention does not mean you can edit it as text. The program may use this file as a binary file, which you cannot edit.

How to copy the names of the subfolders in a folder, so to use them in a batch program (command line)?

I need to check the files of a versioned system. To do that, I need to write a batcha program so to compare the contents of several folders containing the repositories.
So, my question is: how can I "read" the names of all the subfolders inside a folder, so to use these names later to find subfolders having the same names in a different repositories?
I suppose I may use DIR to print on the screen a list of these names but I don't know how to write it on a text file and then read it. Moreover, I should edit this kind of list, anyway.
Any suggestions or new ideas to solve this problem?
I thank gratefully who ever will answer.
it seems that you can get the subfolders using batch file from perl as follows:
system("start C:\\Temp\\mybatchfile.bat");
or you might try to pass your command suggested by #Stephan straight to system and try to handle what it is returned.

Parsing through many files and extract data to a new file?

Ok! My grey hairs have started popping out because of this.
I have 400 PDF files which I want to extract a line from. The line starts with DIR and then a number follows. But I will need the file name as well!
So do anyone know a way to parse through PDFs (or I can convert them to txt) and then search for a term, expand, append file name to it and save it into a new file.
Any help will be greatly appreciated!!
Thanks,
Tor
You have Itext library that you can use for opening the pdf.
Than you will need to scan each pdf for your pattern
The link to the library www.itextpdf.com

Watcher batch file for .txt cloning/reseting/modification

I am trying to create a batch file that works something like a watcher, here is what I am trying to do:
The batch keeps monitoring a .txt file for any modification.
Once the file has been modified by any reason, the batch file proceeds with its function.
The function can vary, either change/replace/delete a line of text inside the file or replace the actual .txt file with a previous clone of it.
After this it keeps monitoring, the cycle repeats itself to prevent the file from being modified.
I do not understand anything of batch, I have tried to find guides and ways of doing it but I am really confused so if anyone could help me with this (a guide explaining how to or the actual final batch) I would be very grateful.
Thank you for your time and patience!
Batch file article on Wikipedia will give you enough information to start understanding batch files.
There is a basic example with explanation that will be helpful getting started with running batch file.
Also take a look at the resources mentioned at the Stack Overflow Batch tag info
Once you know how to write batch files, look for commands that you will require to complete your task.

Resources