Search found 10 matches

by Roy
06 Nov 2018 02:29
Forum: DOS Batch Forum
Topic: Replace node value in multiple xml files
Replies: 7
Views: 8301

Re: Replace node value in multiple xml files

Is there any way to replace the affected line/lines with the following? %replace%%%~nP</%replace%>!

E.g.
<id>20181105abc.xml</id>
by Roy
05 Nov 2018 15:07
Forum: DOS Batch Forum
Topic: Replace node value in multiple xml files
Replies: 7
Views: 8301

Replace node value in multiple xml files

Hello, I am trying to replace some values at once (red ones) with each file's name in several .xml files inside a directory. Example: File name = 20181105abc.xml <id> abcdef </id> <-- 20181105abc.xml <city>London</city> <country>UK</country> <year>2018</year> <type>Business trip</type> <fileid> 1234...
by Roy
04 Sep 2018 01:49
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Re: Exist in /s "directory"doesn't work

Thank you very much Phil, works great and it seems it is faster than the one i created in PowerShell.
by Roy
02 Sep 2018 10:52
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Re: Exist in /s "directory"doesn't work

Thank you for your answer and solution. The problem with time it takes to finish, still persists though. Folder F2 has almost 300k pdf files in subdirs (~80GB). We should first filter the files with modified date of today and then start checking if they exist. If performance is important you made a...
by Roy
02 Sep 2018 02:32
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Re: Exist in /s "directory"doesn't work

@echo off pushD "%userprofile%\desktop\F2" for /r %%i in ( *.pdf ) do if exist "..\F1\%%~nxi" ( for /F "useback tokens=1 delims= " %%? in ( '%%~ti' ) do for /F "useback tokens=2 delims= " %%D in ( '%DATE%' ) do if /I "%%~?" EQU "%%~D" ( move /y "..\F1\%%~nxi" "..\F3" ) else echo. File %%~nxi last m...
by Roy
01 Sep 2018 05:20
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Re: Exist in /s "directory"doesn't work

I only want to search today's files so i must put a date parameter in below command

for /r %%i in ( *.pdf )

something like ( 'date /t' ) or something ,
any ideas?
by Roy
01 Sep 2018 00:32
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Re: Exist in /s "directory"doesn't work

Hello A small modification @echo off pushD %userprofile%\desktop\F2 for /r %%i in ( *.pdf ) do ( if exist "..\F1\%%~nxi" ( move /y "..\F1\%%~nxi" ..\F3 ) else echo File %%~nxi is not a duplicate ) popD Phil It works. Thanks for it. Is there any way to limit the search in %userprofile%\desktop\F2 on...
by Roy
31 Aug 2018 23:58
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Re: Exist in /s "directory"doesn't work

ShadowThief wrote:
31 Aug 2018 21:30
What are you expecting the /s flag to do? The only flag that if has is /i for case-insensitive comparisons.
I am expecting to check if exist in subdirectories also but it doesn't. Is there any other way to do it ?
by Roy
31 Aug 2018 15:36
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Re: Exist in /s "directory"doesn't work

for /f "tokens=* delims=" %%v in ...
corrected
by Roy
31 Aug 2018 14:55
Forum: DOS Batch Forum
Topic: Exist in /s "directory"doesn't work
Replies: 12
Views: 9394

Exist in /s "directory"doesn't work

Hello all, I am trying to build a batch that looks for .pdf files in a folder, checks for duplicates in a second folder and all of its directories and finally if they exist in that (2nd) folder it moves the files from 1st folder to a 3rd one. for better understanding look for .pdf files in F1 if the...