Batch File task in windows - Find and replace across multiple files - batch-file

I have to write a batch file which finds and replaces values of version and build with their new values given by the user as an input.
The user initially gives 3 values: Apps, version and build values (the new values).
The search is then made across multiple .property files in a folder. The Apps value is searched across multiple files and wherever there is a match, the version and build of that file will be replaced by the values given by the user.

To Find and replace across multiple files easily, use FART!

Related

Moving files with a certain file name from one folder to another

i currently have a folder containing thousands of 10-K financial reports.
All of these files are .txt files.
The files look like this:
20170103_10-K_edgar_data_1662618_0001376474-17-000004_1.txt
20170104_10-Q_edgar_data_886137_0000886137-17-000006_1.txt
20170106_10-K-A_edgar_data_1590496_0001477932-17-000065_1.txt
20170106_10-Q_edgar_data_1275187_0001275187-17-000005_1.txt
I only need files that are "10-K" files and contain a certain CIK-number.
e.g. only the files which contain the string "10-K_edgar_data" and the CIK-number "0001376474"
Is there a way to achieve this for multiple 10-K files with different CIK-numbers?
EDIT: I use Mac OS High Sierra. I also have python 2 & 3 and I use it with PyCharm. But for now I only know the absolute Python basics (I am still learning the language...)

Using a batch file to copy multiple files with the same name, and past into new folder with differing names

I have a long list of files that are auto-produced every month. they'll all have the same file name, with a sequential file extension like this:file.001, file.002, file.003
Each file has differing information, despite having the same name. What I need to do is copy them from their home directory and paste them into a new directory with names that reflect their purpose, and as text files, like this: Budget.txt, Expense.txt, Retention.txt
Is it possible to do this with a batch file? I've been unable to find a method that works. Any help would be appreciated.
EDIT: I've tried that solution, and it works as far as it goes. the frustrating thing is that the extensions are not always the same, but always sequentially numbered.

Copying multiple files to a Winscp directory via Script

I have a problem when trying to upload multiple files to one WinSCP directory, i can manage to copy just one single file, but the problem is that i need to upload many files that are generated by a software, the names are not fixed ones, so i need to make use of wildcards in roder to copy all of them, i have tried many variants on the code, but it all was unsuccessful, the code i am using is:
open "sftp://myserver:MyPass#sfts.us.myserver.com" -hostkey="hostkey"
put "C:\from*.*" "/Myserverfolder/Subfolder/"
exit
This code does actually copy the first alphabetically named file, but it ignores the rest of the files.
Any help with it would be much appreciated
Try this in script
Lcd C:\from
Cd Myserverfolder/Subfolder
Put *
Try and do all manually first so you can see what's going on.

exec ant replace a value in a .m file

how to write an exec task in ant to replace two values in .m file.
Because I want to replace the version number in iphone app, including my build number which i build using hudson, i remotely access the macos and get the app to be copied on to my windows
system, so i generated the build using ant exec tasks, but now i want to replace my build number into the concern file before compiling,
so how can i use exec task to replace certain values in a file.
I know propertyfile task which replaces the value in a property file, but it doesn't work for
this.
If you have a template file, you can use the <copy> task with a nested <filterset> to replace certain values. If not, you can still use <copy>, this time with a nested filter chain containing a <replaceregex> token filter. If you want to edit in place, you can move the newly created file to the old location afterwards.
The use of <exec> is almost certainly a bad idea for your application, as it would make your build rely on external applications which usually are not available on all platforms, thus breaking portability of your build.

Copying files multiple times to different destination folders

I want to deploy a plugin for Autodesk 3ds Max with an Inno-Setup. If the end user has 3ds Max installed multiple times (in different folders) for having different languages (3ds Max isnt multilingual) I want the setup to copy the plugin-files to the several 3ds Max folders, but without copying the [Files] Source: "plugin.dll" DestDir: "..." . Can it be done programmatically with the pascal scripting, that the files are copied again but always with changing destination folders?
Why don't you want multiple [Files] entries? They will only be included in the setup once.
If you want to copy them in [Code], you can use the FileCopy() function in either the AfterInstall handler function for the file, or the CurStepChanged(ssPostInstall) event function.
Note that if you install them manually, you lose all automatic reference counting, registration, and uninstall handling, all of which you'll need to replicate in code.

Resources