|
logan0279
初级用户
积分 100
发帖 45
注册 2007-12-11
状态 离线
|
『第
31 楼』:
@echo off
for /f %%b in (a.txt) do set c=%%b
set /a c+=1
echo %c% >a.txt
这个就可以执行一次加一次1了!
|
|
2008-1-5 23:32 |
|
|
kavenlee72
中级用户
积分 369
发帖 87
注册 2003-9-14
状态 离线
|
『第
32 楼』:
楼上的,你这个好象不能在DOS6.22及DOS7.1下使用吧
|
|
2008-1-6 00:03 |
|
|
kavenlee72
中级用户
积分 369
发帖 87
注册 2003-9-14
状态 离线
|
『第
33 楼』:
Quote: | Originally posted by everdos at 2008-1-5 08:21 PM:
用fc试试
test1.bat
--------------------------------------------------------------------------------------------
@echo off
call test2.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
... |
|
请教:fc是什么命令?哪里有得下?
|
|
2008-1-6 00:05 |
|
|
everdos
初级用户
积分 52
发帖 21
注册 2008-1-1
状态 离线
|
『第
34 楼』:
fc是DOS标准命令,用于比较两个文件的内容,去DOS目录里拷贝过来就行了。
不知道楼主想做什么用,如果是想找个程序,每执行一次就将A.txt里面的内容加1,自己编个程序就简单多了。
|
|
2008-1-6 09:58 |
|
|
fastslz
铂金会员
DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
|
2008-1-6 15:54 |
|
|
kavenlee72
中级用户
积分 369
发帖 87
注册 2003-9-14
状态 离线
|
|
2008-1-10 11:06 |
|
|
fastslz
铂金会员
DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第
37 楼』:
估计这个tfind行的,我英文不好,自己看看吧
http://home.mnet-online.de/horst.muc/int/find23.zip
--------------------------------------------------------------------
TFIND String search Ver 2.3 (c) 2001, Horst Schaeffer
--------------------------------------------------------------------
TFIND searches for strings, like MS-DOS FIND, with the following
differences:
* Several strings may be specified. TFIND will search for lines
where all given strings are found (Boolean AND).
* The search can be limited to a field in a fixed field
(i.e. column oriented) list; see option /F
* An extended search mode is available, where only letters and
digits are relevant (option /X)
* Alternative errorlevel with number of lines reported (option /E)
* Case ignored by default, Option /C for case sensitive search
* Only one single file may be given
(use FOR loop to scan several files)
* TFIND expects a text file with lines not exceeding 2048 bytes.
The file size is not limited.
* MS-DOS FIND Options /C (count) and /N are not supported.
Syntax:
-----------
TFIND [options] "string" ["string" ..] input file > output file
The input file will also be read from STDIN, Examples:
TFIND "something" FOO.TXT > RESULT.TXT
TFIND "something" < FOO.TXT > RESULT.TXT
dir | TFIND " " /F1,1 /V > RESULT.TXT
The command arguments are separated by blank space or comma; the
options may be placed anywhere. Strings must be enclosed in double
or single quote marks.
If several strings are given, TFIND selects the lines where all
strings were found (Boolean AND).
For a multiple file scan, use a FOR loop, e.g.:
for %a in (*.TXT *.ASC) do TFIND "something" %a >> RESULT.TXT
Use double redirection symbols to collect the results, and make sure
to delete the output file at the beginning (unless you want to keep
previous results). For file name headers see option /H or /L.
Options:
------------
/Fc,l Search is limited to a field (starting column c, length l)
The string must be completely within the given field.
Default length: rest of line
/C Case sensitive search (case ignored by default)
/V Select (and output) lines where the string was NOT found.
Opposite of the default, which is of course to output all
lines with hits.
/E Set errorlevel to number of lines reported (0..254)
Errorlevel 254 is returned for 254 or more.
Syntax error returns 255.
Note: With option /V as well, the number of lines is
relevant, NOT how many times the string was found!
Default mode: errorlevel 0: string was found, 1: not found
/H Header line with file name. This option is recommended when
files are scanned with a FOR loop. A header is not produced
if there is no output.
Note that MS-DOS FIND writes this header line by default.
No header line generated when the file is read from STDIN.
By default a prefix with 10 dashes plus 1 blank space
is inserted (as with MS-DOS FIND).
/"prefix"
custom prefix string. Use /"" if you want no prefix.
/L Same as /H, however with LFN and full path (Win9x/2000 only)
/X Extended search (see below)
Extended search:
--------------------
With option /X anything but letters and digits is removed from the
lines as well as from the given search string,
i.e. "X-25" is the same as "X #25" or "X25"
"100 Kg" is the same as "100KG"
"03/12/2001" is the same as "03-12-2001" or "03122001"
"preselect" is the same as "pre-select"
There is only one exception: blank space is not removed from the
source line, when occurring between letters, i.e. words in normal
text remain separated. This means:
"newspaper" will NOT find "news paper"
For convenience (when the keywords are specified by user input,
for example), several search strings are not required as individual
strings in quote marks, but may be specified in one pair of quote
marks, and separated by blank space.
i.e. TFIND "foo any X-25" /X
works the same way as TFIND "foo" "any" "X-25" /X
Note that this is only possible with option /X.
Important:
The extended search may produce unwanted hits sometimes. This mode
is meant to preselect lines for further choice by the user.
Language support
--------------------
Upper case conversion is handled for the standard character set
(codepage 437). See CASE103.PAT for country specific modifications.
A special German version is available that handles "Umlauts" in
extended search ("? = "ae" etc.)
*** 15 JUL 2001
|
第一高手 第二高手
我的小站
|
|
2008-1-10 11:53 |
|
|
everdos
初级用户
积分 52
发帖 21
注册 2008-1-1
状态 离线
|
『第
38 楼』:
fc.exe
上传了一个dos6.22的fc.exe到http://greenerycn.ys168.com/的公开下载区。
另外,传了一个Borland C++ 3.1的 grep.com上去,grep.com可按如下方式使用:
grep -w 1 A.txt
if errorlevel 1 goto notfound
(-w表示要全字匹配)
|
|
2008-1-10 20:26 |
|
|
kavenlee72
中级用户
积分 369
发帖 87
注册 2003-9-14
状态 离线
|
|
2008-1-11 14:44 |
|