Search found 23 matches

by billrich
01 Jan 2013 12:06
Forum: DOS Batch Forum
Topic: What method can let me use the PDF files?
Replies: 4
Views: 3985

Re: What method can let me use the PDF files?

windbanasmith wrote:Some friends said they don’t like the PDF files for the restriction of PDF. Now it turns to me, I meeting the same problem. So I need everyone to help me. What method can let me use the PDF files? Thanks

google open pdf files

https://www.download-free.com/pdf-reade ... Qgodw2IA3Q
by billrich
31 Dec 2012 09:19
Forum: DOS Batch Forum
Topic: Reading from a text file
Replies: 14
Views: 9403

Re: Reading from a text file

C:\test>type vel2.bat @echo off echo test=this is test>iamtesting.txt set /p var=<iamtesting.txt set %var% echo var=%var% echo %test% del iamtesting.txt pause Output: C:\test>vel2.bat var=test=this is test this is test Press any key to continue . . . C:\test> P.S. Please explain how the following wo...
by billrich
30 Dec 2012 12:35
Forum: DOS Batch Forum
Topic: Reading from a text file
Replies: 14
Views: 9403

Re: Reading from a text file

foxidrive wrote:

Code: Select all

@echo off
echo test=this is test>iamtesting.txt
for /f "tokens=2 delims==" %%a in (iamtesting.txt) do echo %%a
del iamtesting.txt
pause


works very well. How do I print the second token? Is it %%b?
by billrich
29 Dec 2012 15:54
Forum: DOS Batch Forum
Topic: Reading from a text file
Replies: 14
Views: 9403

Re: Reading from a text file

C:\test>type read2txt.bat
@echo off
type iamtesting.txt
set /p Text=<iamtesting.txt
echo Text=%Text%
)

Output:

C:\test>read2txt.bat
this is the test
Text=this is the test
C:\test>
by billrich
29 Dec 2012 15:20
Forum: DOS Batch Forum
Topic: Reading from a text file
Replies: 14
Views: 9403

Re: Reading from a text file

C:\test>type read3txt.bat @echo off setlocal enabledelayedexpansion type iamtesting.txt for /f "tokens=1-4 delims= " %%j in (iamtesting.txt) do ( set Text=%%j echo Text=!Text! set Text=%%j %%k %%l %%m echo Text=!Text! endlocal ) Output: C:\test>read3txt.bat this is the test Text=this Text=...
by billrich
22 Nov 2012 10:27
Forum: DOS Batch Forum
Topic: Awk and gawk lowercase
Replies: 4
Views: 4429

Awk and gawk lowercase

echo %1 | awk {"print tolower($_)"} echo %1 | gawk {"print tolower($_)"} Output: C:\test>awkgawk.bat ABC C:\test>echo ABC | awk {"print tolower($_)"} abc C:\test>echo ABC | gawk {"print tolower($_)"} abc C:\test>echo abc | awk {"print toupper($_)"} ...
by billrich
19 Nov 2012 17:49
Forum: DOS Batch Forum
Topic: Dostips :toupper case and toLower case
Replies: 1
Views: 2819

Dostips :toupper case and toLower case

Call set %~1=%%%~1:%%~a%% (Please explain how the above line works.) @echo off SETLOCAL ENABLEDELAYEDEXPANSION SET String=%1 Set Case=%2 if !Case!==low goto :lo goto :hi rem SET String :hi echo in hi CALL :toUpper String SET String goto :EOF SET String :lo echo in lo CALL :toLower String SET String ...
by billrich
27 Sep 2012 17:42
Forum: DOS Batch Forum
Topic: my own StrLen function
Replies: 22
Views: 17010

Re: my own StrLen function

@echo off rem jimlen.bat hello world echo Usage: jimlen.bat hello world setlocal enabledelayedexpansion set string=%* :loop set /A cnt+=1 if not "!string:~%cnt%,1!"=="" goto loop echo.string length = %cnt% rem code posted by T.C. at computerhope.com Output: C:\test>jimlen.bat he...
by billrich
23 Sep 2012 14:25
Forum: DOS Batch Forum
Topic: my own StrLen function
Replies: 22
Views: 17010

Re: my own StrLen function

The DosTips strlen function handles all possible strings up to the max length supported by batch (actually maxLength-1), and completes in the blink of an eye. Dave Benham I can find no examples of members using the DosTips strlen function other than the example where the user furnishes the strings ...
by billrich
23 Sep 2012 09:59
Forum: DOS Batch Forum
Topic: my own StrLen function
Replies: 22
Views: 17010

Re: my own StrLen function

http://www.tools4noobs.com/online_php_functions/strlen/


Online strlen() function

int strlen ( string $str )

This tool will display the length of the given text.

Hello World

p.s:

Image

String length: 11
by billrich
22 Sep 2012 08:08
Forum: DOS Batch Forum
Topic: my own StrLen function
Replies: 22
Views: 17010

Re: my own StrLen function

Here is the Dostips strlen that did not work. Please Help. CALL :StrLen "%String%" Len Change that to this: CALL :StrLen String Len When the CALL :strlen String Len is used the Dostips strlen works except previous length repeats when no string is entered? Where can I find a clean copy of ...
by billrich
22 Sep 2012 01:17
Forum: DOS Batch Forum
Topic: my own StrLen function
Replies: 22
Views: 17010

Re: my own StrLen function

Here is the Dostips strlen that did not work. Please Help. but the not DosTips strlen Try to explain in some detail what "doesn't work" for you. Note that the dostips :strlen takes the input string by reference, not by value (i.e. variable name, not its value). Liviu P.S. There is somethin...
by billrich
21 Sep 2012 12:57
Forum: DOS Batch Forum
Topic: my own StrLen function
Replies: 22
Views: 17010

Re: my own StrLen function

Thanks for your replies. I got your strlen code to work Thanks for your help. @echo off :start set Len=0 set "string=" SET /P String=Enter a string (ex: Hello World): CALL :StrLen "%string%", Len ECHO Length = %Len% goto :start EXIT /B :StrLen "Str", NbCar :: StrLen fu...