Search found 177 matches

by amel27
08 Nov 2010 20:25
Forum: DOS Batch Forum
Topic: Prefix, Replace duplicate text in a line
Replies: 1
Views: 3205

Re: Prefix, Replace duplicate text in a line

by AWK for Windows:

Code: Select all

>result.txt awk -F\" -v "C=," "{if ($2==$4) $4 = \"\";print FS\"Col1\"FS C FS$2FS C FS$4FS}" source.txt
by amel27
08 Nov 2010 19:21
Forum: DOS Batch Forum
Topic: Route delete ip
Replies: 3
Views: 4488

Re: Route delete ip

Code: Select all

for /l %%i in (10,1,13) do echo route delete 10.0.1.%%i
by amel27
26 Oct 2010 01:52
Forum: DOS Batch Forum
Topic: MS-DOS Viewing Problem.
Replies: 1
Views: 3477

Re: MS-DOS Viewing Problem.

try ANSI.SYS and COMMAND.COM (instead of CMD.EXE)
Graphics in Batch
by amel27
25 Oct 2010 19:54
Forum: DOS Batch Forum
Topic: Compare date last modified of two files
Replies: 10
Views: 14382

Re: Compare date last modified of two files

Code: Select all

xcopy /d /y "C:\file.txt" "D:\file.txt"
by amel27
25 Oct 2010 19:50
Forum: DOS Batch Forum
Topic: Ipconfig Description
Replies: 2
Views: 8248

Re: Ipconfig Description

so what i want is If a network adaptor has the discription "Cisco VPN" show the IP-adres. via IPCONFIG: @echo off for /f "skip=1 tokens=2 delims=:" %%a in ( 'ipconfig /all^|findstr /ibrc:" *Description .* Cisco VPN$" /c:" *IP Address"') do if not defined IPAd...
by amel27
24 Oct 2010 14:25
Forum: DOS Batch Forum
Topic: Random number calculator help
Replies: 2
Views: 3337

Re: Random number calculator help

Code: Select all

set random1=%random%
set random2=%random%
set sum=%random2%-%random1%
set /a ans=%sum%
echo %sum%=%ans%
by amel27
22 Oct 2010 02:14
Forum: DOS Batch Forum
Topic: Copy files from subfolders to one folder based on criteria
Replies: 8
Views: 8705

Re: Copy files from subfolders to one folder based on criter

well... on MSOffice 2003 XLS files tested... for example, N=3, M=2 (parm of StdInXlsDelCol() func) @set @x=0 /* @dir /b/s/a-d "C:\MyLocalCopies\*.xls"|findstr /vbc:"C:\MyLocalCopies\Dominos"|cscript //nologo /e:jscript "%~0" "StdInXlsDelCol(3)" @dir /b/s/a-d &...
by amel27
20 Oct 2010 20:51
Forum: DOS Batch Forum
Topic: Copy files from subfolders to one folder based on criteria
Replies: 8
Views: 8705

Re: Copy files from subfolders to one folder based on criter

Code: Select all

for %%a in (Dominos PizzaHut) do (
for /f "delims=" %%b in ('dir /b/s/a-d "K:\Franchises\*%%a*"') do (
xcopy /q/y "%%b" "C:\MyLocalCopies\%%a\"
))
by amel27
19 Oct 2010 23:17
Forum: DOS Batch Forum
Topic: Compare date last modified of two files
Replies: 10
Views: 14382

Re: Compare date last modified of two files

by time: for /f %%a in ("C:\file.txt") do for /f %%b in ("D:\file.txt") do ( if not "%%~ta"=="%%~tb" copy /y "C:\file.txt" "D:\file.txt" ) by content: fc "C:\file.txt" "D:\file.txt" >nul||copy /y "C:\file.txt" ...
by amel27
18 Oct 2010 23:34
Forum: DOS Batch Forum
Topic: batch file issue for Dbf to csv
Replies: 13
Views: 13591

Re: batch file issue for Dbf to csv

pradeepcarya wrote:I am in a tough situation.i need to create a batch file to convert .dbf file to .csv.

try this perl script for cmd use (BAT sample inside):
http://www.burtonsys.com/download/DBF2CSV.ZIP
by amel27
18 Oct 2010 06:48
Forum: DOS Batch Forum
Topic: error in tab/space with comma
Replies: 4
Views: 5406

Re: error in tab/space with comma

via native CMD for TAB in file.csv: @(for /f "usebackq delims=" %%a in ("file.csv") do @(set "$a=%%a" SetLocal EnableDelayedExpansion& echo !$a: =,! EndLocal))>"%~dpn0.tmp" @copy /y "%~dpn0.tmp" "file.csv"&& del /f "%~dpn0....
by amel27
18 Oct 2010 02:19
Forum: DOS Batch Forum
Topic: Re: batch scripting
Replies: 2
Views: 3263

Re: batch scripting

Code: Select all

@echo off
SETLOCAL EnableDelayedExpansion

for %%a in ("TST.*") do (
  set "$n=%%~na"& set "$x=%%~xa"
  ren "%%a" "XY!$n:~-6,4!00.!$x:~-3!"
)
by amel27
18 Oct 2010 02:06
Forum: DOS Batch Forum
Topic: Problems with ANSI.SYS
Replies: 2
Views: 4009

Re: Problems with ANSI.SYS

use COMMAND.COM instead of CMD.EXE
by amel27
14 Oct 2010 17:48
Forum: DOS Batch Forum
Topic: Remove prompt from output
Replies: 2
Views: 3865

Re: Remove prompt from output

Code: Select all

@prompt $m
@echo on
by amel27
13 Oct 2010 23:27
Forum: DOS Batch Forum
Topic: Use of FOR in a batch file
Replies: 14
Views: 14724

Re: Use of FOR in a batch file

the code to reproduce error is:

Code: Select all

call fico.cmd
call fico.cmd

this occur because $i var interfered between calls, you must clear it before

Code: Select all

set $i=& for /f "delims=" %%i in ('dir /b/a-d "%d1%\*" "%d2%\*"^|sort') do (
....