Search found 230 matches

by darioit
27 Apr 2018 04:08
Forum: DOS Batch Forum
Topic: get only last file of same type
Replies: 8
Views: 7449

get only last file of same type

Hello everybody, a new problem at least difficult for me In a directory I have different file, I must add each one for same name at 3th position in a new file one and delete it after copy. This is a script and it works fine for /F %%a in ('dir %folder%\*.DDDDDDDD.* /b/a-d/od') do type "%folder%\%%a"...
by darioit
17 Mar 2018 03:47
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 9443

Re: Clean text

another hint, filter is enough on dots ....
thank you
by darioit
17 Mar 2018 01:44
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 9443

Re: Clean text

I try solution from aGerman and works fine except first raw that always is: 2017-01-17 10:50:41 ..... 160045 1485635 aa_bb_cc_dd.pdf where 1485635 show size compressed archive we could parse name starting from "pdf" word, that's a constant, so we get name backwards when find a space or backslashes T...
by darioit
17 Mar 2018 00:22
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 9443

Re: Clean text

sorry it's not a dir command, but "7za l file.zip"

I'll check your solution thank you for help!
by darioit
16 Mar 2018 04:00
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 9443

Re: Clean text

maybe this could works, it's just a regular expression!

Code: Select all

(?:[^ ]+ ){4}(?:.*\\)?(.*)
by darioit
16 Mar 2018 02:13
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 9443

Clean text

Hello,
which is the best way to clean this text from:

2016-04-09 13:16:45 ....A 105907 aa_bb_cc_dd.pdf
2016-04-09 13:16:45 ....A 105907 directory\ee_ff_gg_h.pdf

to:
aa_bb_cc_dd.pdf
ee_ff_gg_h.pdf

Thank you in advance
by darioit
01 Aug 2017 09:06
Forum: DOS Batch Forum
Topic: Remove single quote to pass param
Replies: 8
Views: 7357

Re: Remove single quote to pass param

I choose this one because I need to expand %1 variable in :sub script

Code: Select all

set File=%~1
set File=%File:'=%
call :sub %File%
goto:eof
:sub
by darioit
01 Aug 2017 06:30
Forum: DOS Batch Forum
Topic: Remove single quote to pass param
Replies: 8
Views: 7357

Re: Remove single quote to pass param

yes works, but can I expand "%param1%"

such this echo %~nx1
by darioit
01 Aug 2017 06:07
Forum: DOS Batch Forum
Topic: Remove single quote to pass param
Replies: 8
Views: 7357

Re: Remove single quote to pass param

doesn't work, result is
echo ""

I can't modify %1 string, it's called with single quote
by darioit
01 Aug 2017 04:39
Forum: DOS Batch Forum
Topic: Remove single quote to pass param
Replies: 8
Views: 7357

Remove single quote to pass param

Hello,
I run this batch

c:\script.bat 'D:\dir1\dir2\dir3\file'

I want to remove during execution of script.bat single quote in %1 variable like this D:\dir1\dir2\dir3\file

Sorry I try to search on site but I find only to remove double quote

Thank you in advance
by darioit
16 Jan 2017 08:27
Forum: DOS Batch Forum
Topic: parse string delimiter semicolon void
Replies: 4
Views: 4409

Re: parse string delimiter semicolon void

Thank you very much, works well
by darioit
16 Jan 2017 02:53
Forum: DOS Batch Forum
Topic: parse string delimiter semicolon void
Replies: 4
Views: 4409

parse string delimiter semicolon void

Hello everybody, I got a new little problem I try to parse this raw: @echo off setlocal EnableDelayedExpansion set string=a a;b b;c c;d d;e e;f f;g g;h h;;j;name.pdf echo list = "%string%" for /f "tokens=7,8,9,10 delims=;" %%a in ("!string!") do ( echo Variable 7=%%a ec...
by darioit
06 Oct 2016 01:42
Forum: DOS Batch Forum
Topic: Count number processes executing
Replies: 8
Views: 8992

Re: Count number processes executing

Thank you very much, the first works very well
by darioit
05 Oct 2016 23:58
Forum: DOS Batch Forum
Topic: Count number processes executing
Replies: 8
Views: 8992

Count number processes executing

Hello everybody, I run this command on windows machine TASKLIST /FI "IMAGENAME eq chrome.exe" and the result is: Nome immagine PID Nome sessione Sessione n. Utilizzo mem ========================= ======== ================ =========== ============ chrome.exe 3264 Console 1 131.588 K chrome....
by darioit
03 Oct 2016 04:09
Forum: DOS Batch Forum
Topic: Clean string from "quote" and 'apostrophe'
Replies: 2
Views: 3164

Re: Clean string from "quote" and 'apostrophe'

Thank you very much, it's works fine !!

Best