且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Windows批处理脚本获取文件最后一行中的最后一个单词?

更新时间:2023-11-09 23:43:46

假设您想摆脱//trailer,请添加一个空格作为定界符.

Presuming you want to get rid of the //trailer add a space as delimiter.

@Echo off
For /f "tokens=3delims=| " %%A in (sample.txt) Do Set LastRowCol3=%%A
Echo [LastRowCol3=%LastRowCol3%]