Search found 244 matches

by Endoro
04 Jul 2013 15:57
Forum: DOS Batch Forum
Topic: Fetching specific column from text file using batch file
Replies: 9
Views: 7456

Re: Fetching specific column from text file using batch file

probably you have another date format.
I used the format from the file, you provided.
by Endoro
04 Jul 2013 14:37
Forum: DOS Batch Forum
Topic: Fetching specific column from text file using batch file
Replies: 9
Views: 7456

Re: Fetching specific column from text file using batch file

you can try this script.cmd: @echo off &SETLOCAL ENABLEDELAYEDEXPANSION call:DateToJDN %DATE% JDN5 SET /a JDN5-=5 (FOR /f "tokens=1-5" %%a IN (file.txt) DO ( CALL:DateToJDN %%c jdn IF !jdn! gtr %JDN5% ECHO(%%a %%b %%c %%d %%e ))>file.new goto:eof rem Convert the date to Julian Day Numb...
by Endoro
04 Jul 2013 12:48
Forum: DOS Batch Forum
Topic: Fetching specific column from text file using batch file
Replies: 9
Views: 7456

Re: Fetching specific column from text file using batch file

An input example and desired output would help.
by Endoro
02 Jul 2013 16:10
Forum: DOS Batch Forum
Topic: %~z1 question
Replies: 6
Views: 8926

Re: %~z1 question

What you can try: @echo OFF &SETLOCAL if "%~1" neq "" ( if "%~z1" equ "0" ( echo(file is empty ) else echo(file is not empty ) else echo(no cmdline args found REM -------------------------------- SETLOCAL ENABLEDELAYEDEXPANSION SET "z1=%~z1" if &...
by Endoro
27 Jun 2013 12:11
Forum: DOS Batch Forum
Topic: FindRepl.bat:New regex utility to search and replace strings
Replies: 139
Views: 263096

Re: New regex utility to search and replace strings in files

I miss a "/g:file" option in sed every day (or every other day).
I manage myself with unpleasant constructions such as

Code: Select all

sed -r "s#(.*)#/\1/d#" fileB | sed -f - fileA


It would be nice to have something better :)
by Endoro
22 Jun 2013 02:21
Forum: DOS Batch Forum
Topic: batch variable progress bar string manipulation
Replies: 4
Views: 5375

Re: batch variable progress bar string manipulation

the OP did some cross postings here and here
by Endoro
19 Jun 2013 04:09
Forum: DOS Batch Forum
Topic: How to redirect batch reg query output with findstr?
Replies: 5
Views: 7528

Re: How to redirect batch reg query output with findstr?

your question is already answered here. There is no reason for cross posting. Test the answer first.
by Endoro
18 Jun 2013 09:13
Forum: DOS Batch Forum
Topic: output on display and log file
Replies: 4
Views: 4509

Re: output on display and log file

please look here.
by Endoro
17 Jun 2013 13:11
Forum: DOS Batch Forum
Topic: Remove Last 2 Lines of CSV Files Using For Loop
Replies: 12
Views: 14230

Re: Remove Last 2 Lines of CSV Files Using For Loop

thanks, never tried @echo off &SETLOCAL For %%a In (*.csv) Do CALL:ProcessFile "%%~a" goto:eof :ProcessFile SET "fname=%~1" ECHO(processing %fname% FOR /f "tokens=2delims=:" %%i IN ('find /c /v "" "%fname%"') DO SET "lines=%%i" SET /a l...
by Endoro
17 Jun 2013 12:49
Forum: DOS Batch Forum
Topic: Remove Last 2 Lines of CSV Files Using For Loop
Replies: 12
Views: 14230

Re: Remove Last 2 Lines of CSV Files Using For Loop

yes, this is maybe faster @echo off &SETLOCAL For %%a In (*.csv) Do CALL:ProcessFile "%%~a" goto:eof :ProcessFile SET "fname=%~1" ECHO(processing %fname% FOR /f "tokens=2delims=:" %%i IN ('find /c /v "" "%fname%"') DO SET "lines=%%i" SE...
by Endoro
17 Jun 2013 11:34
Forum: DOS Batch Forum
Topic: Remove Last 2 Lines of CSV Files Using For Loop
Replies: 12
Views: 14230

Re: Remove Last 2 Lines of CSV Files Using For Loop

you can try: @echo off &SETLOCAL For %%a In (*.csv) Do CALL:ProcessFile "%%~a" goto:eof :ProcessFile SET "fname=%~1" ECHO(processing %fname% FOR /f "delims=:" %%i IN ('findstr /n "^" "%fname%"') DO SET "lines=%%i" SET /a lines-=2 SET /a...
by Endoro
17 Jun 2013 11:31
Forum: DOS Batch Forum
Topic: Help with pinging servers, log failures
Replies: 15
Views: 10499

Re: batch file help

SPM wrote: >nul 1 | What does have mean?


- >nul = send standard output to "nul"
- || = in case of an error do
by Endoro
17 Jun 2013 09:38
Forum: DOS Batch Forum
Topic: Help with pinging servers, log failures
Replies: 15
Views: 10499

Re: Help with pinging servers, log failures

@foxidrive, can a computer name/URL contain white space?
by Endoro
17 Jun 2013 08:52
Forum: DOS Batch Forum
Topic: Help with pinging servers, log failures
Replies: 15
Views: 10499

Re: batch file help

test this, also with your PC's

Code: Select all

ping google.com -n 1 && echo success || echo FAILURE
ping google.gov -n 1 && echo success || echo FAILURE
by Endoro
17 Jun 2013 08:24
Forum: DOS Batch Forum
Topic: Help with pinging servers, log failures
Replies: 15
Views: 10499

Re: batch file help

try this:

Code: Select all

For /f %%A in (C:\Document.txt) Do Ping -n 2 %%A 2>&1 || >>PC.txt