简体   繁体   English

使用DOS批处理,读取管道分隔文件中的第二行,并从第三列中提取日期

[英]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.

相关问题 匹配单词的第二次和第三次出现的字符串 - string matching against 2nd and 3rd occurence of the word 获取 Python 中字符串的每第二个和第三个字符 - Get every 2nd and 3rd characters of a string in Python 如何从文本中提取/复制字符串到DOS批处理文件 - How to extract/copy string from text to DOS batch file JavaScript / jQuery:用文本中的第一个,第二个,第三个等代替空格 - JavaScript/jQuery: Replace 2nd, 3rd, etc space with   but not the first one in text 如何获取字符串中的所有内容,直到PostgreSQL中的第二个或第三个逗号? - How to get everything in a string up to the 2nd or 3rd comma in postgresql? 获取字符串中第二个和第三个定界符之间的文本-Java脚本 - Get text between 2nd and 3rd delimiter in a string - Java script 在序号字符串(第二,第八,第三,第一等)上分割地址字符串 - Splitting address strings on Sequential-Number strings (2nd, 8th, 3rd, first, etc..) 如何将字符串的第二个和第三个字符作为 Integer - C89 - How to get the 2nd and 3rd character of a String as Integer - C89 如何使用SQL从格式化的字母数字字符串中提取第一和第二个数字? - How to extract 1st and 2nd number from a formatted alphanumeric string using SQL? 如何使用函数从字符串中提取第一个、第二个和最后一个单词? - How to extract 1st, 2nd and last words from the string using functions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM