Friday, December 24, 2010

Modifying many lines in many files

Hi,

I need to modify a many files, all in the same way.
The modification is to
- add one space-character at the beginning of every line.
- delete the space-character at the end of every line.

In other words:
If the line looks like this:
[start of line]12345 [end of line]

It needs to become:
[start of line] 12345[end of line]

How to do that?

And I want to place this in a batch file (working on windows xp)?

If I call modification described above as
'do the requested adding and deleting'

Can I then create something like:

[start of batch file]
vim - 'do the requested adding and deleting' file1.txt
vim - 'do the requested adding and deleting' file2.txt
vim - 'do the requested adding and deleting' file3.txt
vim - 'do the requested adding and deleting' file4.txt
vim - 'do the requested adding and deleting' file5.txt
vim - 'do the requested adding and deleting' file6.txt
[...]
vim - 'do the requested adding and deleting' file100.txt
[end of batch file]

Rgds,

Jeri

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment