求批处理读取文件的特定字符
我有个日志文件比如说是1.log
文件内容如下:
********************************************************
wertyuiofghjkl;fghjkl;'fghjkl;'dfghjkl;ghjkl;dfghjkl
fgtrytujyiop['oiyuju7o0p-08ol7ikju6yop0o0i8up0o9i80o9
;9l8ok7iuj65hygtr3feddef3ghjikolp;[;p8o7ikuj6hyjo0ploki
lo987iku6j5hygt4rf4g5hujio90p09iku6j5hy5k9o0lkuj76h9ik8
********************************************************
sydid=0000 sys=1111 macaddr=1122334455
要抓取macaddr=1122334455到日志文件2.log中
求批处理命令
------解决方案--------------------
test.bat
BatchFile code
@echo off
>2.log type nul
for /f "tokens=3" %%a in ('findstr "macaddr=" 1.log') do (
>>2.log echo %%a
)