Search found 16 matches

by igor_andreev
19 Jul 2017 10:08
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 20780

Re: how to save response of wget.exe in a variable?

sibianul wrote:

Code: Select all

& was unexpected at this time.



Escape(add caret) before ampersand too.
by igor_andreev
18 Jul 2017 09:30
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 20780

Re: how to save response of wget.exe in a variable?

Try

Code: Select all

wget.exe  "%URL%=%freephysicalmemory%" 2>&1(or 2^>&1 inside FOR)

Wget output to StdErr by default
by igor_andreev
12 Jun 2017 16:04
Forum: DOS Batch Forum
Topic: Extract Text String Between Curly Braces From Multiple Files in a Directory And Save Extracted to File
Replies: 3
Views: 4779

Re: Extract Text String Between Curly Braces From Multiple Files in a Directory And Save Extracted to File

Code: Select all

sed -r -e "s/(\x7b[^\x7b\x7d]{1,}\x7d)/\n\1\n/g" *.txt | sed -n "/^\x7b.*\x7d$/p" | sed "s/^\x7b//;s/\x7d$//" | sort>new.txt
by igor_andreev
22 May 2017 06:02
Forum: DOS Batch Forum
Topic: Extract Values From Todays Date
Replies: 5
Views: 5386

Re: Extract Values From Todays Date

Where do I have to add this code properly? I don't know. It's your computer, your xml-files and your batch What do you mean as 'today's files'? Created today or last modified today? Type in command line: dir /? What do you need, only '/tc' or '/tw'? Which column of your 'dir' output contains the fi...
by igor_andreev
21 May 2017 21:25
Forum: DOS Batch Forum
Topic: Extract Values From Todays Date
Replies: 5
Views: 5386

Re: Extract Values From Todays Date

You can find todays files here: dir /a-d /od /t[cw] *.xml | findstr %date%
by igor_andreev
21 May 2017 02:36
Forum: DOS Batch Forum
Topic: How to extract data from website?
Replies: 33
Views: 31955

Re: How to extract data from website?

Approximate order of actions 1. Download by wget mediafire-URL to anyname.tmp 2. Find in anyname.tmp(it's just html-page) line with words "DownloadButtonAd-startDownload gbtnSecondary" 3. Extract direct link i made step 2 and step 3 in one line with sed&grep: type anyname.tmp | sed s/\...
by igor_andreev
02 May 2017 14:22
Forum: DOS Batch Forum
Topic: Need to run a batch file from Macro Scheduler
Replies: 3
Views: 3963

Re: Need to run a batch file from Macro Scheduler

Sheduler invoked task from 'System' account? Looks like sheduler does not have rights to the network share. And folder was changed to system32 by default. Try add errorlevel after PUSHD, eg: pushd %WORKINGDIR% if errorlevel 1 echo pushd error>c:\error.txt and run from scheduler again. If file c:\err...
by igor_andreev
30 Apr 2017 15:15
Forum: DOS Batch Forum
Topic: How to extract data from website?
Replies: 33
Views: 31955

Re: How to extract data from website?

Code: Select all

grep -P -o "http\:\/\/www\.mediafire\.com[^\x22]*" Doc.txt 

or

Code: Select all

type Doc.txt | geturls | find "mediafire"


geturls.zip(~32kb) here http://ss64.net/westlake/nt/index.html
by igor_andreev
13 Apr 2017 16:25
Forum: DOS Batch Forum
Topic: Batch with Title not showing when executing with Task Scheduler
Replies: 1
Views: 3508

Re: Batch with Title not showing when executing with Task Scheduler

"PELOTON\srvc-oracle" when invoked from Scheduler, not "PELOTON\Administrator". Try run scheduled task as current Logged In user.
by igor_andreev
09 Apr 2017 17:06
Forum: DOS Batch Forum
Topic: Xcopy switch help
Replies: 4
Views: 5674

Re: Xcopy switch help

falcios wrote:xcopy c:\users\user\test e:\test /s /d /e /y /v

Is there a switch to truly copy only source files that have changed, or a switch that I should remove?

Try changing /d to /m
The first time xcopy copies all files, while the next times, it only copies new or changed files
by igor_andreev
05 Apr 2017 03:36
Forum: DOS Batch Forum
Topic: diamond.exe is still required 20 years after, curiosity
Replies: 2
Views: 4902

Re: diamond.exe is still required 20 years after, curiosity

It's not a bug, it's cool undocumented feature for backward compatibility :lol:
by igor_andreev
03 Apr 2017 19:25
Forum: DOS Batch Forum
Topic: Extract information from a website to txt
Replies: 9
Views: 9619

Re: Extract information from a website to txt

Trivial job for external tools.
curl(wget) host | grep regex | sed regex
by igor_andreev
31 Mar 2017 15:59
Forum: DOS Batch Forum
Topic: Assigning a variable based on text search of a file
Replies: 6
Views: 6285

Re: Assigning a variable based on text search of a file

Code: Select all

textw "Setup Verification.pdf" > tmp.txt
for /f "tokens=integer delims=delimiter" %%a in ('type tmp.txt') do ....
....

textw.exe(win32 version 16Kb) here: http://adoxa.altervista.org/misc/index.html
See "Text v1.00 Display readable text within binary files"
by igor_andreev
17 Mar 2017 14:14
Forum: DOS Batch Forum
Topic: Making a batch file start from a specific line of text
Replies: 4
Views: 4885

Re: Making a batch file start from a specific line of text

@ECHO OFF & SETLOCAL ENABLEEXTENSIONS FOR /F "tokens=1 delims=:" %%A IN ('FINDSTR /N /L /C:"\<?xml version=\"1.0\" ?\>" file.ext') DO SET /A "stringline=%%A" IF NOT DEFINED stringline (ECHO Oops & EXIT /B) SET /A "ignore_it=%stringline%-1" I...