从命令行修剪文本文件(Windows) [英] Trimming text files from command line (Windows)

查看:87
本文介绍了从命令行修剪文本文件(Windows)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含数百行的文本文件,例如

I have a text file which contains several hundred lines e.g.

test.bin:8948549854958

它们的样式都类似于上述文件( xxxxxxx.xxx:xxxxxxxxxxxxxx

They are all styled like the above file (xxxxxxx.xxx:xxxxxxxxxxxxxx)

有什么方法可以修剪所有线条,例如采取该行的:xxxxxxxxxxxxxxx ,所以只留下 xxxxxxx.xxx

Is there any way I could trim all lines e.g. take :xxxxxxxxxxxxxxx of the line, so just to leave xxxxxxx.xxx ?

推荐答案

Trim.bat:

@FOR /F "tokens=1 delims=:" %%G IN (%1) DO @echo %%G

用法: trim source.txt> destination.txt

请参见这里

这篇关于从命令行修剪文本文件(Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆