Search found 230 matches

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

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

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

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%
)
by darioit
11 Apr 2016 09:44
Forum: DOS Batch Forum
Topic: Fille spaces from the end of a string via "FOR" command
Replies: 7
Views: 6497

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

Hello I find this example: set str=15 Trailing Spaces to truncate &rem echo."%str%" for /l %%a in (1,1,31) do if "!str:~-1!"==" " set str=!str:~0,-1! echo."%str%" and this is the output "15 Trailing Spaces to truncate space space space " "15...
by darioit
29 Feb 2016 23:55
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 9944

Re: Remove quote in xml file

I try this solution adding

Code: Select all

tr -d "\n" 
but doesn't work

Code: Select all

for /f %%A in ('tail -n1 C:\Meniscus\Data\cc_debug.txt ^| tr -d "\n"') do (
by darioit
29 Feb 2016 13:24
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 9944

Re: Remove quote in xml file

Hello, I have a new issue about this script, very easy This code :Start for /f %%A in ('tail -n1 C:\Meniscus\Data\cc_debug.txt') do ( for /f "tokens=1-6 delims=/,.: " %%A in ("!date! !time: =0!") do ( set "MenTime=<MenTime>%%A/%%B/%%C %%D:%%E:%%F</MenTime>" ) >>"!f...
by darioit
25 Feb 2016 09:37
Forum: DOS Batch Forum
Topic: Store folder name of zip into variable
Replies: 2
Views: 3009

Re: Store folder name of zip into variable

you're alright, sometimes I think difficult solutions for simple things, here the best solutions! @echo off set RESULT= for /f "delims=" %%a in ('7za.exe l -r "ZipArchive.7z" ^| findstr "[0-9].D....\>" ^| find /v "\"') do set RESULT=%%a set FName=%RESULT:~53,5...
by darioit
25 Feb 2016 07:59
Forum: DOS Batch Forum
Topic: Store folder name of zip into variable
Replies: 2
Views: 3009

Store folder name of zip into variable

Hello, I have a zip archive "ZipArchive.7z" which inside this structure: FolderName\Document1.pdf FolderName\Document2.pdf I like to put only "FolderName" into variable. I wrote this code: 7za.exe l -r "ZipArchive.7z" | FINDSTR "[0-9].D....\>" | FIND /V "...
by darioit
30 Dec 2015 03:31
Forum: DOS Batch Forum
Topic: Move files and place a Windows link
Replies: 2
Views: 3496

Re: Move files and place a Windows link

This is not a script! This is a masterpiece !!!

It's works very well, thanks again!
by darioit
29 Dec 2015 02:22
Forum: DOS Batch Forum
Topic: Move files and place a Windows link
Replies: 2
Views: 3496

Move files and place a Windows link

Hello Everybody, I find my old script to copy all particular extensione file from a disk to another disk replicating asis the same directory structure xcopy /yisd D:\*.7z Z:\D\%1 xcopy /yisd E:\*.7z Z:\E\%1 Now I like to improve this script deleting a file successfully copied and replace it with a W...
by darioit
26 Nov 2015 05:06
Forum: DOS Batch Forum
Topic: Extract chars from string
Replies: 4
Views: 3929

Re: Extract chars from string

alredy test, doesn't work

for /f %%a in ('dir /b') do (
set variable=%%a:~0,2
echo !variable!
)
by darioit
26 Nov 2015 04:42
Forum: DOS Batch Forum
Topic: Extract chars from string
Replies: 4
Views: 3929

Extract chars from string

Hello,
How can I run this basic batch

Code: Select all

for /f %%a in ('dir /b') do echo %%a:~0,2


I need only first 2 chars

Thank you
by darioit
14 Oct 2015 02:10
Forum: DOS Batch Forum
Topic: Update variable in a For loop
Replies: 3
Views: 3358

Re: Update variable in a For loop

Good now works, many Thanks

10:09:28.74
10:09:29.75
10:09:30.79
10:09:31.83
10:09:32.86
10:09:33.90
10:09:34.94
10:09:35.99
by darioit
14 Oct 2015 01:45
Forum: DOS Batch Forum
Topic: Update variable in a For loop
Replies: 3
Views: 3358

Update variable in a For loop

Hello folks,

why in a FOR loop, %time% variable doesn't update?

Code: Select all

@echo off
for /f "delims=" %%a in ('dir /b *.*') do (
   echo %time%
   )


Result:
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81

Thank you
by darioit
10 Sep 2015 06:11
Forum: DOS Batch Forum
Topic: Set Conter 5 digit
Replies: 2
Views: 2947

Re: Set Conter 5 digit

Perfect works fine, many thanks!