I'm new to batch files and I can't even grasp how to begin a batch script to accomplish what I really need. I'm not sure if it's even possible, but I hope somebody can help, it would be very much appreciated. What I want to do is count from right to left 17 characters and remove the remainder. Below is an example:
我是批处理文件的新手,我甚至无法掌握如何开始批处理脚本来完成我真正需要的东西。我不确定它是否可能,但我希望有人能提供帮助,我将非常感激。我想要做的是从右到左计数17个字符并删除其余部分。以下是一个例子:
A.C.D,ABCDEFGH,ABCDEFGH
A.F.N,R,ABCDEFGH,ABCDEFGH
L.V.X.A.C.D,ABCDEFGH,ABCDEFGH
OUTCOME
ABCDEFGH,ABCDEFGH
ABCDEFGH,ABCDEFGH
ABCDEFGH,ABCDEFGH
Any ideas? Thanks in advance if anybody can help :)
有任何想法吗?如果有人可以帮助,请提前感谢:)
1 个解决方案
#1
0
You just need to use Bash substring extraction:
您只需要使用Bash子字符串提取:
myvar=A.C.D,ABCDEFGH,ABCDEFGH
echo ${myvar:(-17)}
that should do what you want.
应该做你想要的。
#1
0
You just need to use Bash substring extraction:
您只需要使用Bash子字符串提取:
myvar=A.C.D,ABCDEFGH,ABCDEFGH
echo ${myvar:(-17)}
that should do what you want.
应该做你想要的。