[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 如何提取文件名中指定字符后面的部分并输出到txt文件中?

本帖最后由 pcl_test 于 2016-3-25 13:04 编辑

有一文件夹全部是jpg的图片,文件名如下:
  1. w7in9xxee__sqvu
  2. w7in9wmbv__jgwke
  3. w7in9ytrs__xp4ei
复制代码
请问怎样把__后面的内容复制并逐行保存到txt文本中?
即最终实现的txt内容文本如下:
  1. sqvu
  2. jgwke
  3. xp4ei
  4. ……
复制代码
1

评分人数

回复 3# happy886rr
  1. {"BSSID":"0b:17:bf:aa:01:50","IpAddress":"10.97.27.110","P2p0Mac":"97:b3:f7:ed:09:fc","SSID":"PHICOMM_bad1f4","androidId":"2d66649f1a5259a1","batteryLevel":73,"btAddress":"50:2b:77:03:2c:03","btName":"2014501","buildAbi":"armeabi-v7a","buildAbi2":"armeabi","buildBoard":"roth","buildBrand":"Xiaomi","buildCodename":"REL","buildDescription":"HM2014501-user 7.1.2 NMF26Q fae5a1bd release-keys","buildDevice":"HM2014501","buildFingerprint":"Xiaomi/2014501/HM2014501:7.1.2/NMF26Q/fae5a1bd:user/release-keys","buildHardware":"qcom","buildHost":"sp-ci-01-desktop","buildId":"NMF26Q","buildIncremental":"fae5a1bd","buildManufacturer":"Xiaomi","buildModel":"2014501","buildName":"Xiaomi","buildProduct":"HM2014501","buildRadioVersion":"rusqpfccc","buildRelease":"7.1.2","buildSdk":"25","buildSerialno":"0b80dbeb","buildTags":"release-keys","buildType":"user","buildUser":"MarkBuild","buildUtc":1494391198147,"cellScan":["26666,191583233","22465,211652363","55232,161504425","22310,25291","16654,53"],"ci":161504425,"contacts":["奶奶,13300844303","姑妈,15505206633","外婆,13490537600","外公,18706374435","舅舅,18803713506","舅妈,15605678555","姨父,15205685027","姨娘,15701536582","亲爱的,13104695192","老弟,14700830894","老妹,13401386105","小明,15503165245","小李子,15007033282","井璎权,13201496049","Amy Fox,13207755936","闵同若,13200111167","吴恒思,13805410132","司徒许念,18808671868","Crystal Warren,18707355887","沈适,13206355554","邹游微,15904982253","韩信,15900176272","Elaine Morales,15804190230","诸葛雨魄,13507890425","李涂舒,18706446216","李校雄,18805753250","Jon Marshall,15703292865","蓝郡厚,13902037285","王恒建,15601437002","齐魁超,18804751374","Charlotte Foster,14700628628","吴虎,15201858990","吴彦,13304710999","杨经,13806175764","Gail Miller,13605917498","诸为翼,15607138938","贝乐杏,15500461988","张雍,18602845361","Janet Gomez,15500124586","云联康,13801122856","李演,15803298129","李岭谷,18801575981","Donald Sanders,18701445924","鲁情凇,14707993213","方默信,18604072696"],"cpuName":"MT6582","densityDpi":320,"deviceId":"860151286932132","deviceSvn":"53","displayId":"HM2014501-user 7.1.2 NMF26Q fae5a1bd release-keys","droid62":"{258\u003d860151286932132\u0026 256\u003dA86015128693213\u0026 259\u003dXiaomi2014501: swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt: ARMv7 Processor rev 2 (v7l): 7: MT6582: 0000000000000000}","extraInfo":"ctlte","filePath":"/storage/emulated/0/.money/backup/20180508/13199407469_wxid_6pswdo8216t722_20180508.aw","height":0,"hidePkgs":[],"hmNotes":"","hookPkgs":[],"id":693,"lac":55232,"latitude":31.0023387,"line1Number":"13199407469","longitude":119.9684878,"macAddress":"8f:77:a5:6f:c9:e4","memAvailable":24045939,"memFree":72137820,"memTotal":96183759,"mnc":"01","networkClass":3,"networkCountryIso":"cn","networkOperator":"46001","networkOperatorName":"中国联通","networkType":13,"networkTypeName":"LTE","phoneType":1,"rgAndroid":"23","rgAreaode":"86","rgConNames":["喔喔","Vfdw Abpob"],"rgConsize":"0","rgCountry":"中国","rgDevice":"比特币","rgIp":"124.160.214.215","rgLastLogin":1531328913754,"rgLocation":"浙江省杭州市 联通","rgNetType":"切换飞行模式","rgOrPhone":"13199407469","rgPhoneNo":"13199407469","rgServer":"飞行模式切换","rgTime":1525792679667,"rgVcode":"AW(接码/发码)","rgVersion":"2.1.5","rgWxEmail":"未绑定","rgWxError":"","rgWxId":"wxid_6pswdo8216t722","rgWxName":"喔喔","rgWxNo":"wxid_6pswdo8216t722","rgWxPasswd":"hihihi762903","rgWxQQ":"未绑定","rgWxStatus":"存活","rgWxWindows":"否","serialno":"0b80dbeb","simCountryIso":"cn","simOperator":"46001","simOperatorName":"中国联通","simSerialNumber":"8986094186873846211","simState":5,"subscriberId":"460013126117265","type":0,"typeName":"MOBILE","width":0,"wifiScan":["MERCURY_d6b991,34:ce:00:74:4d:24,[WPA2-PSK-CCMP][WPS][ESS],-55,2427,1445737211","TP-LINK_a65559,ec:82:63:41:f4:78,[WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS],-62,2427,344020914","TP-LINK_d22105,68:9f:f0:f3:13:00,[WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS],-89,2412,283533012","Netcore_7cba87,04:5f:a7:3e:0c:1c,[WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS],-75,2432,498377594","Tenda_440ffe,50:3a:a0:16:96:ba,[WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS],-76,2412,386784201"]}
复制代码
帮我看看我这个呢。我只要"rgWxNo":"wxid_6pswdo8216t722","rgWxPasswd":"hihihi762903",    引号里面的文本。导出来是这样wxid_6pswdo8216t722----hihihi762903

TOP

  1. @echo off&(for /f "tokens=1* delims=__" %%a in ('dir /a-d /s /b *.jpg') do (echo %%~nb))>new.txt
复制代码
回复 1# 每天几分

TOP

本帖最后由 luotexiaozh 于 2016-3-25 09:22 编辑
  1. @echo off
  2. for /f "tokens=2* delims=_"   %%a  in ( 'dir /s /b /a-d  "*.jpg"' )  do ( echo %%~na>>1.txt )
复制代码

TOP

返回列表