Search found 378 matches

by !k
06 Apr 2012 07:48
Forum: DOS Batch Forum
Topic: BATCH rename files using a criterion txt file?
Replies: 18
Views: 14709

Re: BATCH rename files using a criterion txt file?

@echo off &setlocal enableextensions set /a cnt=0 for /f "delims=" %%a in ('dir /b /on *.txt') do call :ren "%%a" goto :eof :ren for /f "tokens=1" %%b in ('more +%cnt% log.log') do ( echo ren %1 "%%b.txt" set /a cnt+=1 &goto :eof )
by !k
31 Mar 2012 08:18
Forum: DOS Batch Forum
Topic: tabulators
Replies: 23
Views: 17496

Re: tabulators

8 not expected

Code: Select all

SET /A remainder=(40-strlen) %% 8
by !k
30 Mar 2012 10:51
Forum: DOS Batch Forum
Topic: tabulators
Replies: 23
Views: 17496

Re: tabulators

doscode wrote:This part of job is too hard for me
And I inattentive :oops:
dbenham wrote::: Aborts with an error message to stderr and errorlevel 1 if IntVal
:: corresponds to one of the following problematic characters:

so text editor is single way :roll:
by !k
30 Mar 2012 10:29
Forum: DOS Batch Forum
Topic: tabulators
Replies: 23
Views: 17496

Re: tabulators

2)
"for/f" loop w/o "delims" uses tab & spase as delimiters. Use it.

or use right text editor again

Code: Select all

set "Tab=   "
for /f "tokens=1,2* delims=%Tab%" %%a in (file.txt) do echo %%a%Tab%%%b
by !k
30 Mar 2012 10:20
Forum: DOS Batch Forum
Topic: tabulators
Replies: 23
Views: 17496

Re: tabulators

1)
http://www.dostips.com/forum/viewtopic.php?f=3&t=1733 wrote::: 9 0x09 011 TAB (horizontal tab)

or simple use right text editor

Code: Select all

set "Tab=   "
echo Cplumn1%Tab%column2 > file.txt
by !k
28 Mar 2012 11:20
Forum: DOS Batch Forum
Topic: Split string to characters
Replies: 32
Views: 44153

Re: Split string to characters

Words from a phrase into Variables viewtopic.php?p=9814#p9814
by !k
28 Mar 2012 11:14
Forum: DOS Batch Forum
Topic: [Question] Echoing Veriables in Veriable..
Replies: 11
Views: 7949

Re: [Question] Echoing Veriables in Veriable..

foxidrive wrote:

Code: Select all

@echo off
set SRC=1
set SR%SRC%=12
echo %SR1%
call echo %%SR%SRC%%%
pause

or

Code: Select all

@echo off
setlocal enabledelayedexpansion
set SRC=1
set SR%SRC%=12
echo %SR1%
echo !SR%SRC%!
pause
by !k
26 Mar 2012 07:14
Forum: DOS Batch Forum
Topic: Variable manipulation
Replies: 3
Views: 3665

Re: Variable manipulation

w/o DelayedExpansion

Code: Select all

call set var1=%%var1:%var2%=%%
by !k
24 Mar 2012 11:14
Forum: DOS Batch Forum
Topic: How to check if 3 files exist,and them delete'em
Replies: 1
Views: 2478

Re: How to check if 3 files exist,and them delete'em

Code: Select all

if exist "name1" if exist "name2" if exist "name3" (del "name1" "name2" "name3" &echo s > file.txt)
by !k
23 Mar 2012 13:14
Forum: DOS Batch Forum
Topic: search for list of filenames in a single file
Replies: 10
Views: 9342

Re: search for list of filenames in a single file

it defaults to regex

Hmm... Image
by !k
20 Mar 2012 12:00
Forum: DOS Batch Forum
Topic: add "echo" comand at the begining of every line [solved]
Replies: 5
Views: 4502

Re: add "echo" comand at the begining of every line

Code: Select all

set "img=image.txt"

>%img%.cmd (
echo:@echo off
for /f "delims=" %%a in (%img%) do @echo:echo:%%a
echo:pause^>nul
)