I use VISUAL BLOCK mode to cut the last column by pressing "x" and add it to the new file by pressing "p".
It is so boring to do the same work for hundreds times.
Is that possible to write a script to do this job?
For example,
I have five files named file1 file2 file3 file4 file5. I add a column of number to file1, how to add the same column to other files?
Any suggestion will be greatly appreciated. Thanks in advance!
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags
```text
and
```
by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
I'm a new guy for this high quality forums. Sorry for the bad style of my post.
The first column numbers added to the end of each line have beed done by hand.
But I still have dozens of files need to add the same column.
I used the Visual Block mode by pressing 'x' and the add this column to a new file by pressing 'p'.
Now, I would like to know if some script can be made to do this work?
Actually, these numbers ('1' or '2') were difined by myselt to show two different fragments. So for the first input file, I must add this column numbers by hand.
Then I try to copy this column numbers into other files, which will be put into the same position.
For instance, this column will be put start at the end of line 9.
I hope I could make me much clear about this question.
Simply to say, I just want to use a script to copy the last column numbers from the the first file added by hand to the other files which contain the same lines.
:o