增 编 Alberge, I was hoping of findings that wouldn t required sed since this batch file will be used within adownpageed file in a即窗环境中,以简化配置。 但参看I ll必须包装:。
As for the rest of you, the whole premise of a collaborative question/answer directory implies that the person asking the question is either:
1) unable to find an answer
2) short on time and is looking for advice from those with more experience or knowledge in the subject matter.
批评我说,由于我受时间限制,我正在问一个问题,有些是谨慎的。
引人注意的是,我发现这种有用和紧凑的手稿是用这种手法复制纸——。 是否存在任何象通用的物体。
我在此再说一遍:
Dim pat, patparts, rxp, inp
pat = WScript.Arguments(0)
patparts = Split(pat,"/")
Set rxp = new RegExp
rxp.Global = True
rxp.Multiline = False
rxp.Pattern = patparts(1)
Do While Not WScript.StdIn.AtEndOfStream
inp = WScript.StdIn.ReadLine()
WScript.Echo rxp.Replace(inp, patparts(2))
Loop
我的成稿:
@echo off
set full_path=%CD%file_1.txt
set input_file=file_2.txt
set output_file=file_2.txt
set str_search=FIND_ME
set str_replace=%full_path%
if not exist "%full_path%" (echo this file does not exist...)&goto :eof
cscript //nologo sed.vbs s/%str_search%/"%str_replace%"/ <%input_file% >%output_file%
a. 类似药房的工作: