Help with editing a file
-
Hello, I am working on something and I need to be able to turn a file like this:
Banana
Apple
Mango
PearInto this:
Banana-Banana
Banana-Banana1
Banana-Banana2
Banana-Banana3
Banana-Banana123
Apple-Apple
Apple-Apple1
Apple-Apple2
(continuing down)You get the point. Anyways, is there any way to do this in notepad++? A script or plugin I could download? Any help would be greatly appreciated.
-
well it depends on how complex it goes.
given
Banana
Apple
Mango
Pearand using regular expressions like
find what: ^(.+)$ replace with: \1-\1\r\n\1-\11\r\n\1-\12\r\n\1-\13\r\n\1-\1123would result in
Banana-Banana
Banana-Banana1
Banana-Banana2
Banana-Banana3
Banana-Banana123
Apple-Apple
Apple-Apple1
Apple-Apple2
Apple-Apple3
Apple-Apple123
Mango-Mango
Mango-Mango1
Mango-Mango2
Mango-Mango3
Mango-Mango123
Pear-Pear
Pear-Pear1
Pear-Pear2
Pear-Pear3
Pear-Pear123\1 = what was found in the line
\r\n = carriage return new line feed on windowsCheers
Claudia -
Thank you so much! This helped a great deal.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login