I need to paste a large amount of text (so no ctrl+f > replace possible) over another text, and I need it to be ONTOP of the other text, at the end of the line. Example:
Textfile 1:
|apple=
|banana=
|long yellow armchair=
|wooden lamp post with glue=
... (1600 more lines exactly like that)Textfile 2:
[[Apfel]]
[[Banane]]
[[Lange gelbe Couch]]
[[Hölzener Lampenpfosten mit Kleber]]
... (1600 more lines exactly like that)Result needs to be:
|apple=[[Apfel]]
|banana=[[Banane]]
|long yellow lamp post with glue=[[Lange gelbe Couch]]
|wooden lamp post with glue=[[Hölzener Lampfenpfosten mit Kleber]]
... (1600 more lines exactly like that)I tried copy pasting from textfile 2 over textfile 1 but it just replaces the text obviously. A note is that the lines and correct order is 100% guruanteed by me already, meaning line 1000 on file 1 is exactly the start of line 1000 of file 2, etc. I also tested column editing but it seems like all the lines need to be the same lenght, or need to be known beforehand so that didn't work either. I thought this would be a very minor task, as in "paste ontop of old text" since all lines are already an exact match, but some research leaves me with no answer to achieve this very simple task. Any clues on how to do this paste?
2 Answers
As suggested by @Toto, column mode is the solution, but there are several gotchas that need good consideration:
Open Textfile 1 and click at the beginning of the file
Scroll to the last line without moving the cursor by using the scrollbar
Use Alt+Shift+Click at the end of the file. It's important that the click be done at a column position that is beyond the longest line in the file, or some text will not be transferred. It is not required to add blanks, as click in column mode can be done in any empty space.
Press Ctrl+C to copy the columnar text
Open Textfile 2 and ensure that the first line is longer than any other line in the file by adding blanks. This is important, or some text will be pasted in the middle of some line
Click at the end of the first line
Press Ctrl+V to paste
If you need to get rid of excessive blanks, use replace-all repeatedly to convert sequences of more than one blank to exactly one blank.
You can solve your problem like this:
- Open textfile1 and copy all the lines
- Open textfile2 and in column mode select the first column
- Paste the lines
- Done.