Search found 5 matches

by capiot23
15 Nov 2023 11:11
Forum: DOS Batch Forum
Topic: [Solved] Move file to incremental subfolder based on file name prefix
Replies: 3
Views: 18267

Re: Move file to incremental subfolder based on file name prefix

I think this works: @echo off setlocal EnableDelayedExpansion cd /D X:\PROJECT set "number=0" for %%a in (*.xml) do ( set "file=%%a" set "num=!file:~5,1!" if !num! neq !number! ( set /A "number=num, count=1" ) else ( set /A "count+=1" ECHO move "!file!" !count! ) ) Output: move "FIL005_202311101134...
by capiot23
14 Nov 2023 16:45
Forum: DOS Batch Forum
Topic: [Solved] Move file to incremental subfolder based on file name prefix
Replies: 3
Views: 18267

[Solved] Move file to incremental subfolder based on file name prefix

Hello guys, I have a folder named " PROJECT " with subfolder " 2 ", " 3 ", " 4 ". I have also few files named FIL004_xxx.xml , FIL005_xxx.xml , FIL006_xxx.xml , FIL007_xxx.xml as shown below X:\PROJECT | FIL004_20231110113437.xml | FIL005 _20231110113443.xml | FIL005 _20231110113444.xml | FIL005 _20...
by capiot23
14 Nov 2023 09:01
Forum: DOS Batch Forum
Topic: [Solved] Need help to convert single line xml file to sequential line
Replies: 7
Views: 27421

Re: Need help to convert single line xml file to sequential line

Sir, apologize for my overlooked on the rules. I'm just worry I'd leak out some private information from the actual data, but after read by lines, there's nothing much to worry. Ok. This new code correctly works with the 262 KB size file. My first attempt fails because I assumed that no value could ...
by capiot23
13 Nov 2023 01:07
Forum: DOS Batch Forum
Topic: [Solved] Need help to convert single line xml file to sequential line
Replies: 7
Views: 27421

Re: Need help to convert single line xml file to sequential line

This should get you started. https://stackoverflow.com/questions/33077104/batch-script-for-formatting-xml-files-search-for-strings-and-comment-them-out Hey thanks, but this doesn't skip the first 2 tags and I don't want it to be format like this <xml> <tag> <othertag> </othertag> </tag> </xml> This...
by capiot23
10 Nov 2023 08:18
Forum: DOS Batch Forum
Topic: [Solved] Need help to convert single line xml file to sequential line
Replies: 7
Views: 27421

[Solved] Need help to convert single line xml file to sequential line

Hi everyone, Can anyone help me write a code to convert xml file from single line to sequential line. Let say I have this data.xml (single line) <?xml version="1.0" encoding="UTF-8"?><Document xmlns="urn:iso:std:iso:20022:tech:xsd:sese.024.001.01"><SctiesSttlmTxStsAdvc><Id><Id>22052046</Id><CreDtTm>...