Is it possible to merge all text from 1 file with another file
-
Okay here goes I just learned recently how to rename multiple movie files based on the site title and renamed several files quickly. But I’m still having issues with my YouTube trailer downloads since the names are all over the place.
Example below of the file names:Criminal (2016 Movie) Official Trailer – “Remember”.mp4|
Crimson Peak Official Trailer #1 (2015) - Tom Hiddleston, Jessica Chastain Movie HD.mp4|
Darkman Official Trailer #1 - Liam Neeson Movie (1990) HD.mp4|
Dreamer Inspired by a True Story Trailer (2005).mp4|
From Time To Time - Trailer.mp4|
GHOSTBUSTERS: FROZEN EMPIRE - Official Trailer (HD).mp4|These are the trailer files which are just smaller video files I also have the movie files that have all already been named correctly and I have also taken the movies and made a clean copy of a txt file in Notepad++ so the clean list looks like below.
Criminal (2016) trailer
Crimson Peak (2015) trailer
Darkman (1990) trailer
Dreamer Inspired By A True Story (2005) trailer
From Time to Time (2010) trailer
Ghostbusters Frozen Empire (2024) trailernow here is what I would like to do I would like to move the entire clean list and match them up with the original trailer list and save it as a bat file to quickly rename the files.
Because I know now that if I place ren full file location of the trailers and then a space and then the title of the movie after the file location I can have the file name like this “Criminal (2016)-trailer.mp4” and then save it as a bat file and place the file inside the downloads movie folder and then have all the movie trailers renamed quickly without needing to copy and paste all a the titles.
So basically what I’m trying to do is this:
- All the trailers are inside a folder called Trailers
- The file names are pretty random so I was hoping to move the text from 1 file to another all at once if possible
- So far I have tried this “Right click tab and move to other view”
- Take both files and organize by alphabet some are out of place though
- Organized so each clean title matched up with the unclean file names
- The clean titles are 71 lines and the file names that need to be changed are 71 but with spaces it depends on how long the file names currently are
Is there a way to move the entire list from the clean titles to the file names to be renamed with replace or is there a way to go to the file names and after the "space place a " and then place the title names. I have them all in the correct order but I don’t know if this is even possible.
Currently every file name is enclosed by “file name” like this and the titles look like this Title (YEAR) trailer I do still need to edit the trailer titles a little I need to go from (YEAR) trailer to (YEAR)-trailer but that is all. Otherwise I will need to copy and paste every single line of title to the file name copy as path txt file each time I need to bulk rename files. So I was just wondering if there was a easier way with a bat file or replace or something I’m still pretty new to using Notepad++ I have only ever really used it to make simple ahk scripts.
-
@CheapSweetLife said in Is it possible to merge all text from 1 file with another file:
Is there a way to move the entire list from the clean titles to the file names to be renamed with replace or is there a way to go to the file names and after the "space place a " and then place the title names. I have them all in the correct order but I don’t know if this is even possible.
Yes, it is possible. The feature you’ll want to use is called a “rectangular selection.”
In the file with the new names, click at the very beginning of the file. Now, scroll down (use the scroll bar or the mouse wheel, not the keyboard) to the end of the file and Shift+Alt+click far enough into the empty space at the right of the last line that you get a selection box which encloses all the text on all lines. (That might sound confusing; try it, and you’ll see what I mean.) Scroll (again, using the scroll bar or the mouse wheel, not the keyboard) through the file and make sure the selection includes all the text on all the lines. (If it doesn’t, go back to the bottom and Shift+Alt+click further to the right.)
Now, copy that to the clipboard (Ctrl+c).
In the other file, click at the end of the first line and add enough spaces that you are at least one extra space to the right of the longest line in the file. Now, paste (Ctrl+v).
-
@Coises
okay I have been able to select the text and move the text correctly to the beginning of each line I find that a little easier then trying to find the end of the lines I know that sounds odd but this is easier for me I guess.So now I have something like below:
“Darkman (1990)-trailer” “C:\Users\Sweet\Downloads\YouTube\Random World Random Life\Trailers\Darkman Official Trailer #1 - Liam Neeson Movie (1990) HD.mp4”
“Dreamer Inspired By A True Story (2005)-trailer” “C:\Users\Sweet\Downloads\YouTube\Random World Random Life\Trailers\Dreamer Inspired by a True Story Trailer (2005).mp4”
“From Time to Time (2010)-trailer” “C:\Users\Sweet\Downloads\YouTube\Random World Random Life\Trailers\From Time To Time - Trailer.mp4”I want to take the “Darkman (1990)-trailer” and move it to the end of the file name so it would be moved after mp4" .
So is there a way to move the first set of text inside the first set of double quotes to the end of each file name after mp4" space. Is this possible and if so could you tell me how.
So far I now know how to rename bulk movie files with ren and saving the file as a bat file and then running the file I figure I could do something similar with the trailers.
So the line would start by looking like below:
“From Time to Time (2010)-trailer” “C:\Users\Sweet\Downloads\YouTube\Random World Random Life\Trailers\From Time To Time - Trailer.mp4”And then would end up looking like below:
“C:\Users\Sweet\Downloads\YouTube\Random World Random Life\Trailers\From Time To Time - Trailer.mp4” “From Time to Time (2010)-trailer”And then I would place ren before the "C and then I would save as bat and then I could run as bat to rename all trailers at once. How do I swap the first double quote text to after the second set of double quoted text.
I do know the end of the second sent of double quoted text always ends in mp4" so I hope this helps.
-
@CheapSweetLife said in Is it possible to merge all text from 1 file with another file:
So is there a way to move the first set of text inside the first set of double quotes to the end of each file name after mp4" space. Is this possible and if so could you tell me how.
That’s a simple regular expression. You might as well add the ren while you’re at it:
Find what:
^"([^\r\n"]+)"\s+("[^\r\n"]+")$
Replace with:ren $2 "$1.mp4"
(From your example, I gather the new names you have lack the .mp4 extension, which you’ll need in the rename command, so I included that in the replacement.)
I don’t want this to sound snippy, but… that’s pretty basic regular expression use. At this point, you probably should have a look at the manual and begin to understand these things for yourself. It’s worth learning, because it will come in handy for solving all sorts of problems.
-
@Coises
Thank you for the help with all of this I have saved the link to the page you linked to to my bookmarks.