[英]Using DOS batch, read 2nd line in a pipe delimited file and extract date from 3rd column
I need to extract a date from a text file. 我需要从文本文件中提取日期。 File is in pipe delimited format.
文件采用竖线分隔格式。 It has series of columns which might or might not have value.
它具有一系列可能有价值的列。 I need a date from the 3rd column in second row.
我需要第二行第三列的日期。 After that, write that date in a new file.
之后,将该日期写入新文件。 How to do that?
怎么做?
THANKS!!! 谢谢!!!
Something like this in a batch file? 批处理文件中是这样的?
for /f "skip=1 tokens=3 delims=|" %%G IN (%1) DO (echo %%G > %2)
Skips the first line and outputs the 3rd token in a pipe delimited file. 跳过第一行并在管道分隔文件中输出第三个令牌。 File is provided as the first argument (%1) and then it is echo'ed.
提供文件作为第一个参数(%1),然后将其回显。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.