batch-processing

Writing the same output to multiple logs

为君一笑 提交于 2019-12-25 05:06:41
问题 Is it possible to write the same output to more than one file in Batch? My reason for wanting to do this is because I have a large batch script that produces a very detailed log. This is fine as it is, but i want to also output a trimmed back version of the log with a lot less detail in it. The Batch cannot be run multiple times either. Say for instance I have a simple batch: Echo This is a Batch Script >> Path\File1 & Path\File2 osql -S%SERVERNAME% -E -d%DATABASENAME% -Q%SQL% >> Path\File1

Spring Batch moving file after processing

一曲冷凌霜 提交于 2019-12-25 04:57:05
问题 I am new to Spring batch. I have to read multiple files(delimiter) from a folder and load them in DB. Which I did. But my issue is after each file is processed I have to move the file to processed folder or error records to Error folder. For example if I process a below file ( abc.txt ) from multiple file: D|hello1|123 D|hello2|three - Error D|hello3|123 I know that 2nd record is an error. Now I have to write the error record in a error file( abc-error.txt ) to error folder and proceed with

Build a batch query for MySQL insert each 1000 items

痴心易碎 提交于 2019-12-25 04:52:26
问题 I need to perform a batch insert in MySQL/MariaDB but since data is dynamic I need to build the proper SQL query. In a few steps: I should find whether the current row exists or not in table - this is the first SELECT inside the loop Right now I have 1454 but have to insert around 150k later, is better a batch query than 150k INSERT per item on the loop If record already exists I should update it if doesn't then I should insert ,I just not care about UPDATE yet and the code you're seeing is

PHP Not executing .bat file in windows

a 夏天 提交于 2019-12-25 04:42:41
问题 I am trying to execute a batch file using PHP on Windows Server 2008. The file is called NEWDNS.bat and its purpose is to write a new entry into a DNS zone file stored in c:\windows\system32\dns . The zone file is named motlocal.co.uk . Here are the contents of newdns.bat @echo off cd windows\system32\dns\ dnscmd dsvr012345 /recordadd motlocal.co.uk mynewsubdomain A 88.208.200.221 dnscmd dsvr012345 /ZoneReload motlocal.co.uk newdns.bat is stored in the same directory on the server as the PHP

Batch command to move many folders inside an alfabetic directory structure

久未见 提交于 2019-12-25 04:30:17
问题 I have this content inside a directory [FOLDERS] Atomic Animal Cat flash Zoe [FILES] text.txt audio.rar I want to reorder moving folders inside an alfabetic directory structure like this (case is irrilevant). I want move only folders no files A [Atomic, Animal] C [cat] f [flash] Z [zoe] file1.rar file2.txt where A,C,f,Z are parent folders. Folders in bracket are MOVED folders not CONSOLIDATED folders! Which .bat command can I use? I want move inside a unique folder called A for all folders

Batch command to check for partial filename then move

别等时光非礼了梦想. 提交于 2019-12-25 04:18:05
问题 I'm in need of a batch command that will look into a directory's sub folders and find a partial file name. If that file exists, then move that directory otherwise leave it alone. I have a folder full of movies: D:\Movies\movie1\ \movie2\ \movie3\ Within each movie folder I would like to know if it has a trailer downloaded into the folder, if so then move that directory to x:\movies . I say partial file name as every trailer file will include the title of the movie with " -trailer " added to

Executing batch file in C# web service

前提是你 提交于 2019-12-25 03:59:14
问题 I am trying to execute a batch file in C# web service. I am sure that the batch file has no problem. The problem I am facing is that the batch file will be executed only in debugging mode. It won't produce error nor being executed when I connect with the client machine. I am sure that there is nothing wrong with the connection since I can successfully send something from client to web service. Here is the code: try { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc

How to move files from a directory to another directory based on file size

。_饼干妹妹 提交于 2019-12-25 03:55:22
问题 I am currently working on an automation project at work. One of the steps to the program that I need to separate files that are greater than 6000KB from the other files in the folder. I am looking for a batch file that is able to move files that are greater than 6000KB from their current directory to another directory. I need this batch file to do handle a batch of files and not just one. Any thoughts on how to do this in a batch file? 回答1: If you want to use VBScript, you can use this script

Batch processing multiple files at the same time [duplicate]

白昼怎懂夜的黑 提交于 2019-12-25 02:46:40
问题 This question already has answers here : Parallel execution of shell processes (5 answers) Closed last year . I have this batch command @echo off FOR %%i in (C:\input\*.*) DO ( echo processing %%i if not exist "C:\output\%%i" process.exe "%%i" -out "C:\output\%%i" ) echo ---- finished ---- pause Here my tool process.exe processes in a loop all files within a directory - if a result doesn't already exist. Now my CPU is fast enough to run this process.exe on 2 or 3 files at the same time which

Batch: How to store values encountered during a regular expression search & replace (repl.bat)

て烟熏妆下的殇ゞ 提交于 2019-12-25 01:37:01
问题 Using Batch, I'm looking for a way to (1) search for a regular expression pattern and (2) store variables within that pattern... so I can use those variables while doing a search and replace. I've been using REPL.BAT, which was created by @dbenham (original REPL.BAT post and earliest StackOverflow post). Here's an example of the scenario. I search a document for the occurence of the following code: driver.find_element_by_id("username").send_keys("rwbyrd") driver.find_element_by_id("password")