I have one file and contains:
file2.txt
PRIMERB
PrinceValiant
Priory
PRISTINA
embossed
heavy
incised
light
Outline
ribbon
Add space characters to the end of the first line of file1 until it is longer than the longest line in file1.
Do a column mode selection of the entire contents of file 2. Do this by holding the ALT key down while dragging the mouse across the file. As you drag you should see a rectangular area of the screen selected. It may be easiest to start the selection before the first character in the first line of file2. Could also do a column mode selection with just the keyboard. Hold the ALT and Shift keys down while moving the cursor with the arrow keys.
Copy the selected text. (Control-C or menu => Edit => Copy or context menu => copy.)
Paste after the spaces added to file1.
Remove unnecessary spaces.
If the existing spaces in files1 and file2 are important you might use a regular expression to alter every line in file2 to have some character or character sequence that does not occur in either file before selecting its contents. For example, find ^
and replace with !!
. Then you can use another regular expression to remove only the spaces added by the paste. For example, replace _*!!
(space, asterisk, exclamation-mark, exclamation-mark) with _
(space; note that spaces would show incorrectly in these two strings, so they are shown as underscores _
for clarity).
See also the Editing => Column mode editing section of the Notepad++ help pages.
Instead of finding some way of automating this, I think it'll be easier for you to just copy & paste...
But that purely depends on how many rows of text you got in those text files. If they contain less then 50 lines, I suggest you just copy (or cut) and paste.
I wouldn't know any way to automate that in Notepad++ anyway.
Edit:
After your request I wrote a quick PHP script that takes the lines from 'file1.txt' and 'file2.txt' and combines it to 'file3.txt'
<?php
$files1 = file('file1.txt'); // read file1.txt
$files2 = file('file2.txt'); // read file2.txt
// Assuming both files have equal amount of rows.
for($x = 0; $x < count($files1); $x++) {
$files1[$x] = str_replace(array("\n", "\r"), "", $files1[$x]);
$files3[$x] = $files1[$x]." ".$files2[$x];
}
$result = implode("", $files3); // combines the array to a single string.
if(file_put_contents('file3.txt', $result)) { // puts the imploded string into file3.txt
echo "Writing to file 'file3.txt' was successfull.";
}
?>
Now I would like to help you best I can, but I cannot access my own domain at this time, and I have not yet wrote something for you to upload your own files to it.
You can run this your own by downloading the latest USBWebserver
1. Extract the files from the .zip you downloaded from the USBWebserver website.
2. Go to the just extracted 'root' folder.
3. Delete everything inside that 'root' folder.
4. Copy the code above and save it as 'index.php' inside the 'root' folder (you can do this with notepad++ too).
5. Move your 'file1.txt' and 'file2.txt' to the same 'root' folder.
6. Go up one folder and execute 'usbwebserver.exe'.
7. Click on 'localhost' when the window pops up.
8. If you get the message: "Writing to file 'file3.txt' was successfull." you should now have 'file3.txt' in that 'root' folder.
Maybe you can try ConyEdit. It is a cross-editor plugin for the text editors, including Notepad++.
Follow the steps below:
1, keep ConyEdit running.
2, use the cc.gl a
command line to push data to array a.
3, use the cc.gl b
command line to push data to array b.
4, use the cc.p
command line to print the contents of the array a and array b.
Gif Example