monitor changes in a folder windows 7 - compare

Ultimately, I want a way (a free way) to monitor changes in a folder and then output those changes to text file. Now this would need to be done programmatically as im using autohotkey to start the process and id like it if it was unseen by the user. I've tried copying the contents of the folder to text file before the change then after the change then using findstr to compare the two and only output the difference to text file. But, findstr outputs false positives. It would output file names as differences even though I can visually confirm they are the same in both files. I need something similar to findstr.
I need something to work like this:
file1.txt
file1.mp3
file2.mp3
file3.mp3
file2.txt
file1.mp3
file2.mp3
file3.mp3
file4.mp3
diff.txt
file4.mp3
Findstr works exactly how I need it to work except for the errors.
findstr /lv /g:file1.txt file2.txt>diff.txt
The error I speak of is with the case sensitivity on, I get 2 files in diff.txt that I know are the same in file1.txt and file2.txt. With case sensitivity off, I get like 30 0r 40 files that are the same in both.
Autohotkey has a very round-about way to accomplish this but I would much prefer a simpler way. Either batch, vbs, or anything else that will run natively on windows 7 or a standalone exe. Something relatively simple and free.
What I am trying to achieve is whatever file is added to the folder, a text file is then created, with the same file name minus the extension, and added to dropbox then IFTTT detects the file and notifies me via sms that 'filename' has finished downloading.
I finished and perfected the method of texting the download link to my pc (via a combination of AHK, batch and IFTTT) which automatically downloads the file. Now I just want a way to be notified its done.

Related

When a file changes, I'd like to modify one or more different files

I've been scouring the web for hours looking for an approach to solving this problem, and I just can't find one. Hopefully someone can fast-track me. I'd like to cause the following behaviour:
When running ember s and a file of a certain extension is changed, I'd like to analyze the contents of that file and write to several other files in the same directory.
To give a specific example, let's assume I have a file called app/dashboard/dashboard.ember. dashboard.ember consists of 3 concatenated files: app/dashboard/controller.js, .../route.js, and .../template.hbs with a reasonable delimiter between the files. When dashboard.ember is saved, I'd like to call a function (inside an addon, I assume) that reads the file, splits it at the delimiter and writes the corresponding splitted files. ember-cli should then pick up the changed source (.js, .hbs, etc.) files that it knows how to handle, ignoring the .ember file.
I could write this as a standalone application, of course, but I feel like it should be integrated with the ember-cli build environment, but I can't figure out what concoction of hooks and tools I should use to achieve this.

Automate dekstop screening with Python

I am trying to make a program that could automatically scan the images or texts on a user's desktop and then convert it to a .txt file for text analysis.
So far I have found source codes to convert PDF and HTML into .txt. However I would like to make my program automatically scan the desktop screen at certain time intervals rather than manually inputting the source such as:
$pdf2txt.py samples/simple1.pdf
I don't know where to start so any suggestion will be appreciated.
First of all, the desktop is just a location in the file directory like:
C:\Users\Kirsteen\Desktop
So the next step would be to search through this directory for the types of files you are interested in. You'd be aiming to generate a list of valid file names that need to be converted. This Q/A might help you.
Once the files have been found run those converting scripts you have. To repeat this automatically put all of this in a loop and add a delay so that it runs once an hour/week.
To tidy things up, think about running this process in the background and making sure the program doesn't convert the files more than once if they haven't changed.

Sublime Find and Replace without having to click save

When I do a global search/replace in a project, Sublime will automatically open all the files involved, and not save them. I then have to manually save every single file.
Is there a way to have Sublime automatically save all the changes that have been done, and not open the files that where not previously open?
Thanks in advance for anyone who can help me with this.
http://www.sublimetext.com/forum/viewtopic.php?f=3&p=40348
I think it's Option + Command + S(Mac) or Command + Alt + S(Win).
Just performed a similar task with the free Visual Studio Code. Replace in Files without opening files and fast. Just made 60k changes in just a few minutes.
Robust if awkward.
While it doesn't change the fact that Sublime Text doesn't seem to be the best tool for this job, here's a practical workaround procedure I've come to rely on. It's reasonably slow but painless if done correctly. Memory consumption impact seems negligible, if you're wondering. The ballpark of my use cases is up to about 10k files in up to a handful of minutes on a mediocre memory-cramped machine using Sublime Text 3.2.2 (3211) on Windows 10 Pro x64.
Requirements
You'll need the package SideBarEnhancements to be installed.
…which in turn relies on Sublime Text 3 or newer as of writing this.
Procedure
(Could probably be deferred until step 3.) You add the directory A that you're going to operate on to the project sidebar.
You initiate your batch replacement operation over numerous files inside directory A.
Sublime Text takes its time to open numerous tabs belonging to directory A recursively and perform replacement in each.
You right-click on the directory A in the project sidebar to bring up its context menu and choose "Save Views".
Sublime Text takes its time to save each tab belonging to directory A recursively.
You right-click on the directory A in the project sidebar to bring up its context menu and choose "Close Views".
Sublime Text takes its time to close all tabs belonging to directory A recursively.
Disclaimers
Warning
Do not make the mistake of skipping step 3 or you'll effectively become stuck in a GUI loop of writing confirmation dialogs defaulting to "Yes" for however many thousands of files you're operating on.
If you decide to abort operation between steps 2 and 3 — your best course of action, is to back the files up on disk, proceed with the outlined procedure and then restore the backup.
Caution
All of the tabs belonging to the directory you'll operate on will be closed by the end of this procedure. If you need a substantial portion of them to remain open throughout replacement — consider organizing the files contained into a sub-directory structure conducive to cherry-picking.
General advice
As a rule of thumb, before proceeding with this procedure, it would be wise to check if the required context menu entries are in fact present (greyed out or not) in your combination of editor+package versions. And to be on the safe side, you might want to back up your data and Sublime Text session before massive operations.

Reading output from the command line

I'm trying to write a simple GUI for Wget. I'm looking for advice on how to read information from the command line output that Wget generates when it is doing a run. I'd like to update that download information real time to a list box or some equivalent. The GUI will be in Visual Basic. I know programs like WinWget do this, and their source code is available, but I don't know the language that's written in well enough to find what I'm looking for.
tl;dr: I need to update a list box real time with command line output.
There are two ways to use the output of one console application for the input of an other:
The first way is to use the | operator; for example:
dir |more
The second way is to write the data into a file and process it later.
dir > data.txt

Convert .odt .doc .ods files to .txt files

I want to convert all the .odt .doc .xls .pdf files to .txt files.
I want to convert these files to text files using a shell script or a perl script
There's a program for odt files and alikes:
odt2txt - avaliable in repos.
$ unoconv --format=txt document1.odt
Should produce document1.txt.
OpenOffice has a built-in document converter capable of handling a bunch of formats- take a look at unoconv: http://dag.wieers.com/home-made/unoconv/
That being said, I have had some troubles getting that to work in the past- If you're having trouble, take a look at similar programs for AbiWord (another open source word processor).
For word documents, you can try antiword, at least on linux. It's a command line utility that takes a word document as an argument, and spits out the text from that document (as best as it can figure) to Standard Output. Maybe you can specify an ouput file too. I can't remember the details of how it works. I haven't used it in a while. Not sure if it can handle OO documents.
It's certainly possible to do this, though there is something strange and impenetrable about the OO project and its documentation that makes things like this hard to research and follow. However, OO has the capability to convert all of those types, not just the OO native ones, and it can do it via two different forms of automatic control.
These are the two general approaches.
You can start OO and tell it to execute a macro which does this job for you for a given file. You then just have to write the macro and a script to loop over your files. The syntax is something like
$ oowriter -headless filename macro://dir/Standard.Module1.sMySub
The other thing OO has is a network API. This is based on something called UNO.
$ oowriter -accept=accept-string
Notifies the OpenOffice.org software that upon the creation of
"UNO Acceptor Threads", a "UNO Accept String" will be used.
You will need some sort of client library. I think they have one for Python at least. Using this technology a Python program or some other scripting language with an OO client library could drive the program and convert all the files. Since OO reads MSO, it should be able to do all of them.
Open the file in LibreOffice. Click on "File", "Save-as" scroll down to find the text option. Click that and it will be saved as a text file.
FYI, I had an *.ODT file that was 339.2 KB in size. When I save-as text the size of the file shrunk to ONLY 5.0 KB. Another reason for saving your files as text files.
For the Microsoft formats, look into the wvWare tools.
Open .ods file normally in libre office
Highlight text to be converted
Open a terminal
Run vi
Press "i" to get insert mode
Press ctrl-shift-v
Done!
Need some formatting?
Save the file as
Get out of vi
Run:
$cat | column >filename2
This worked in opensuse running KDE
Substitute "kwrite" for "vi", if you want