I would like to know if it's possible, using a batch file, to strip the rightmost character from each line in a file, and if so, how? That is, for example, I would want this file:
foo|bar|xyz|
123|456|789|
To become this:
foo|bar|xyz
123|456|789
You may assume I'm using Windows XP or higher. I would also like to avoid having to write an entire new file to the disk, since the files I'm working with are quite large. Rather, I would like to modify the existing file.
Question
Mr_Miguel
Greetings.
I would like to know if it's possible, using a batch file, to strip the rightmost character from each line in a file, and if so, how? That is, for example, I would want this file:
foo|bar|xyz|
123|456|789|
To become this:
foo|bar|xyz
123|456|789
You may assume I'm using Windows XP or higher. I would also like to avoid having to write an entire new file to the disk, since the files I'm working with are quite large. Rather, I would like to modify the existing file.
Thank you in advance.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts