Hello, please, can someone write a probably simple script for me?
I'd like it to paste this text:
<start>
Unused <number>
<end>
Except these <start> and <end> markers. Whereas <number> are the first numeric letters from the previous line and I'd like it to paste a new line after that (like when I hit enter).
The text file is full of things like this:
648) Something
Something, something...
So I want to replace the line "something, something..." with text "Unused 648".
There is always the end of bracket symbol - ) after the number and the number is between 0 - 9999.
I dont know how to script in Python and I never needed to, I just want it to do this, because its annoying to select line, paste Unused and rewrite the number manually over a over again like 1000 times.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From the description I don't know that I understand what you are trying to do, but is it perhaps something that a regular expression replace operation could do more easily than a Pythonscript?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So under every 1115) Line3 (the number and name isn't always same) I want to change description to Unused 1115 (without writing the number manually) + a blank new line, like when I press enter.
Hello, please, can someone write a probably simple script for me?
I'd like it to paste this text:
<start>
Unused <number>
<end>
Except these <start> and <end> markers. Whereas <number> are the first numeric letters from the previous line and I'd like it to paste a new line after that (like when I hit enter).
The text file is full of things like this:
648) Something
Something, something...
So I want to replace the line "something, something..." with text "Unused 648".
There is always the end of bracket symbol - ) after the number and the number is between 0 - 9999.
I dont know how to script in Python and I never needed to, I just want it to do this, because its annoying to select line, paste Unused and rewrite the number manually over a over again like 1000 times.
From the description I don't know that I understand what you are trying to do, but is it perhaps something that a regular expression replace operation could do more easily than a Pythonscript?
For example, I want to change this:
1113) Line1
Text, text, text...
1114) Line2
Text, text, text...
1115) Line3
Text, text, text...
To this:
1113) Line1
Unused 1113
1114) Line2
Unused 1114
1115) Line3
Unused 1115
So under every 1115) Line3 (the number and name isn't always same) I want to change description to Unused 1115 (without writing the number manually) + a blank new line, like when I press enter.
Search on this regular expression:
((\d+)\).+\R).+(\R)
and Replace with this:
\1Unused \2\3\3
If this isn't what you want then you are expressing your need poorly?
Thank you very much :) Thats exactly what I needed!
Always think of the non-script solution first because it is probably easier! :-)