Search found 212 matches

by darioit
17 Mar 2018 00:22
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 3870

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: 3870

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: 3870

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: 2954

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: 2954

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: 2954

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: 2954

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: 2196

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: 2196

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: 4096

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: 4096

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: 1627

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

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

Best
by darioit
03 Oct 2016 03:51
Forum: DOS Batch Forum
Topic: Clean string from "quote" and 'apostrophe'
Replies: 2
Views: 1627

Clean string from "quote" and 'apostrophe'

Hello,

how can I clean this string from
html += "src='https://text1.com/text2/text3-text4/text5.txt'";


to
https://text1.com/text2/text3-text4/text5.txt


Thank in advance
by darioit
17 May 2016 01:43
Forum: DOS Batch Forum
Topic: Replace a substring using position string substitution
Replies: 1
Views: 1652

Replace a substring using position string substitution

Hello,
I find this script for string substitution

Code: Select all

set str=teh cat in teh hat
echo.%str%
set str=%str:teh=the%
echo.%str%


How can I modify this script specifying a string position, in this case change string "teh" if it found only a position 11,3

Thank you
by darioit
11 Apr 2016 22:41
Forum: DOS Batch Forum
Topic: Fille spaces from the end of a string via "FOR" command
Replies: 7
Views: 3195

Re: Fille spaces from the end of a string via "FOR" command

good, like this:

Code: Select all

for %%a in ('command') do (
set MYVAR=                                        %MYVAR%
set MYVAR=%a%%MYVAR%
set MYVAR=%MYVAR:~-40%
)