batch-processing

Batch - I would like to search with a variable in one file and replace that variable result in another file

有些话、适合烂在心里 提交于 2019-12-13 06:03:50
问题 I would like to search using a variable in one file, then take that variable result and replace part of some text in another file. For exmaple in "1.txt" I have a text line of: ClassName=X X changes within the file depending on the line of text that you search ClassName= So I would have to search using a variable with ClassName= I would then search for X in another file after the word "Class=", replacing it with the word "ShipDummy". We'll call the second file "2.txt". X within the second

Cannot change number of clusters in KMeansClustering Tensorflow

我们两清 提交于 2019-12-13 04:46:49
问题 I found this code and it works perfectly. THe idea - split my data and train KMeansClustering on it. So I create InitHook and iterator and use it for training. class _IteratorInitHook(tf.train.SessionRunHook): """Hook to initialize data iterator after session is created.""" def __init__(self): super(_IteratorInitHook, self).__init__() self.iterator_initializer_fn = None def after_create_session(self, session, coord): """Initialize the iterator after the session has been created.""" del coord

En Dash in file path batch job query

梦想与她 提交于 2019-12-13 04:22:48
问题 Hoping someone can help. I have a batch job (Windows env) which simply copies a file to another folder. copy "\\ACP-MS-NAS21\Global\MEC Daily Productivity\Business Analysts\Master_List\HCP_Master_List.xlsx" ^ "\\ACP-MS-NAS21\Global\CSD [?] DWP Medical Services\CSL_CSD_DB\Master_List" But I get the following error: The filename, directory name, or volume label syntax is incorrect. I can see there's an en dash in the file path which I believe is causing the problem. Is there any way to have a

How to effectively and correctly load sequential activities to Database using Spring batch?

别等时光非礼了梦想. 提交于 2019-12-13 03:55:51
问题 I'm currently working on a project loading a .dat file info to database. However, this .dat file contains not only data but also actions. The first field indicates the action of the records and all else are just data. Below are some examples records: A key1 key2 data1 data2 D key1 key2 data1 data2 C key1 key2 data1 data2 let, A=add, D=delete, C=update The file size is roughly 5GB. In this case, order of the records to be process does matter. Is it possible to use Spring batch to batch process

Batch Script to Update text in the properties file

与世无争的帅哥 提交于 2019-12-13 03:54:11
问题 I have a question regarding the batch. I have a properties file in Directory. Which has a text "BuildNumber=0". I want to replace this "BuildNumber=0" with "BuildNumber=%BUILD_NUMBER%". I am using the following script to achieve this @echo on setlocal enabledelayedexpansion enableextensions ATTRIB -r -s C:\bldarea\myfile\..\..\jenkinstest\abc.properties CD C:\bldarea\myfile\file\Main_Releases\jenkinstest\ call :FindReplace "Buildnumber=0" "Buildnumber=%BUILD_NUMBER%" abc.properties exit /b

Batch check and replace string then wait for a process

拈花ヽ惹草 提交于 2019-12-13 03:27:20
问题 I need a batch file witch will: check inside user.cfg file for string "g_language = Russian" and leave it if finds it but if sting is set to "g_language = English" then set it to "g_language = Russian" wait for some.exe to start and when it is started change string "g_language = Russian" to "g_language = English" How can I do this? I used this code but my result is: Russian=g_language = English= Russian @echo off &setlocal set "search=g_language = Russian" set "replace=g_language = English"

copy folder to multiple servers with different %userprofile%

半世苍凉 提交于 2019-12-13 03:23:31
问题 I do not have access to GPO or AD/OU, so what I found to do the easiest was to create a batch file for users. Here is what I want to achieve : I have over 50 servers, and 10 users that will be connecting to these machines. On those different machines, I want to populate, from 1 location (1 main server, 1 main location/main user), all the internet favorites (C:\Users\MAIN USER\Favorites\Links) to everyone on every machine... I want to create a batch file, with minimum user manipulation, . So

replace a number in .properties file through batch file

南笙酒味 提交于 2019-12-13 03:20:49
问题 I have a .properties file say abc.properties file. It has a text BuildNumber=0. I want to search the BuildNumber and replacw its value with current build number through batch file. Please if someone can help. I am new to batch scripting. Any help would be appreciated. Thanks 回答1: Here is another way using a batch/vbs hybrid script. @echo off setlocal call :FindReplace "Buildnumber=0" "Buildnumber=1.21" abc.properties exit /b :FindReplace <findstr> <replstr> <file> set tmp="%temp%\tmp.txt" If

Best batch practice to run a second command with &&

好久不见. 提交于 2019-12-13 03:20:22
问题 i'm looking for best practice in a situation where i want to send two commands to a separate window. as in: start /wait command1 && command2 this works however the second command is not executed in the new window instead runs in the initial window after the first task is finished. how should a situation like this be handled correct? 回答1: You cannot do it directly with start but cmd supports that using quotes: start /wait cmd /c "command1 && command2" You probably can use cmd directly: cmd /c

Spring-batch : How to catch exception message with skip method in spring batch?

和自甴很熟 提交于 2019-12-13 02:49:06
问题 I am a novice of spring batch. My question is how to catch exceptions with the skip method in spring-batch? As I know, we can use a skip method to skip them when some exceptions happened in spring batch. But how can I get the exception message with skip method? somebody suggested me use SkipListener ,this class has three call back method like onSkipInProcess() ,but it is no use for me. And ItemProcessListener did not work either. The code like below:(I use skip method to ignore the exception