【问题标题】:Split text file using batch使用批处理拆分文本文件
【发布时间】:2015-06-17 03:18:41
【问题描述】:

我正在尝试将文本文件中的以下数据拆分为两个单独的文件。一个文件应包含以 =x 和 =newcase 结尾的最后 4 行,另一个应包含以 1515 开头的其余行...任何想法将不胜感激

1515861=Nomura Qatar Employment Advice
1515863=Nomura Bahrain Employment Advice
1515869=GSCEC . Gozzo Impianti S.p.A. - Conference Centre Project
1517106=Exterran - General Employment Advice
OFFICE=Office=X
NEW=New Case=X
OFF=Office=X
1111111=New Case

【问题讨论】:

    标签: batch-file text split


    【解决方案1】:
    type "c:\file" | findstr /i /e /c:"=x" >part1
    type "c:\file" | findstr /i /b /c:"2525" >part2
    

    【讨论】: