Remove words if second Word not contains
Hello!
i got 2 diffrent questions
1. I want to change a random specified word with my current first word (for example:"eat" "drink" "sleep") thats my randomlist
for example current filename - "play is my life.png"
now i want a random name for this
3 options are possible
(possible after filenames):
"eat is my life.png"
"drink is my life.png"
"sleep is my life.png"
2. I want to remove every words thats dont begin with the second word with a "#"
for example: current name :
"Video #eat #sleep #train #learn #play #TELEVISION 8 | watch #concentrate #watch #drive.mp4"
and i want: "Video #eat #sleep #train #learn #play #concentrate #watch #drive.mp4"
i got 2 diffrent questions
1. I want to change a random specified word with my current first word (for example:"eat" "drink" "sleep") thats my randomlist
for example current filename - "play is my life.png"
now i want a random name for this
3 options are possible
(possible after filenames):
"eat is my life.png"
"drink is my life.png"
"sleep is my life.png"
2. I want to remove every words thats dont begin with the second word with a "#"
for example: current name :
"Video #eat #sleep #train #learn #play #TELEVISION 8 | watch #concentrate #watch #drive.mp4"
and i want: "Video #eat #sleep #train #learn #play #concentrate #watch #drive.mp4"
1) Use a Replace method to replace the first word with a random number between 1 & 3 then add a List replace method to replace the numbers with your "random" words...
Replace ^[^ ]*
with <Rand:1:4>
Use regular expressions
List replace:
Replace: ^1 with: eat
Replace: ^2 with: drink
Replace: ^3 with: sleep
Use regular expressions
2) Your second question is barely English and your example is inconsistent- please be more clear!
Replace ^[^ ]*
with <Rand:1:4>
Use regular expressions
List replace:
Replace: ^1 with: eat
Replace: ^2 with: drink
Replace: ^3 with: sleep
Use regular expressions
2) Your second question is barely English and your example is inconsistent- please be more clear!
Reply to #2:
Do you mean:
Starting with the second word, remove every word that does not begin with the character "#", where a "word" is defined as any group of characters terminated with a space or the end of the filename?
If so...
Remove pattern: " [^#][^ ]*"
Use regular expressions
Do not include the quotation marks in the pattern - but note that the pattern begins with a space.
However this will return: "Video #eat #sleep #train #learn #play #TELEVISION #concentrate #watch #drive.mp4"
Otherwise your second question does not appear to make any sense.
Do you mean:
Starting with the second word, remove every word that does not begin with the character "#", where a "word" is defined as any group of characters terminated with a space or the end of the filename?
If so...
Remove pattern: " [^#][^ ]*"
Use regular expressions
Do not include the quotation marks in the pattern - but note that the pattern begins with a space.
However this will return: "Video #eat #sleep #train #learn #play #TELEVISION #concentrate #watch #drive.mp4"
Otherwise your second question does not appear to make any sense.