How do I make textpad do this?
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
How do I make textpad do this?
Hi,
I just downloaded Textpad this morning.
Let's say that I have this 3 words in Textpad:
word #1
word #2
word #3
…
word #100
I want to make it like down below (adding a coma for word 2 until word #100):
word #1
, word #2
, word #3
, …
, word #100
How do I do this kind of stuff using Textpad? I used the search function in this forum but I could not find a solution.
Regards,
dedotno1
I just downloaded Textpad this morning.
Let's say that I have this 3 words in Textpad:
word #1
word #2
word #3
…
word #100
I want to make it like down below (adding a coma for word 2 until word #100):
word #1
, word #2
, word #3
, …
, word #100
How do I do this kind of stuff using Textpad? I used the search function in this forum but I could not find a solution.
Regards,
dedotno1
Several ways to do what you want.
run a regular expression to insert the comma from the 2nd line down - you could then automate this process by recording a macro and assigning to a keystroke if it is something you may do a large number of times.
you can put the editor in block mode and select the first column and "Fill" the first column with a comma.
you can just record a macro and insert the comma without a regular expression.
you need to get used to the editor and how to select text/find replace/use regular expressions - the help is good.
run a regular expression to insert the comma from the 2nd line down - you could then automate this process by recording a macro and assigning to a keystroke if it is something you may do a large number of times.
you can put the editor in block mode and select the first column and "Fill" the first column with a comma.
you can just record a macro and insert the comma without a regular expression.
you need to get used to the editor and how to select text/find replace/use regular expressions - the help is good.
You can make a simple search and replace using regular expression.
Search for:
and replace with:
This will work if the line contains an actual word so it start with a letter. It will not insert a comma in front of the first word if the first word start at line 1 and it will not add a comma for empty lines if you have any blank lines inbetween. If your lines might contain something that is not a actual words like start with a number, with a space or a special characters you have to change it a bit to work correctly.
You can also make this into a macro for later use like ACRobin said.
Search for:
Code: Select all
\n^([A-Za-z].*)$
Code: Select all
\n,\1
You can also make this into a macro for later use like ACRobin said.
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
If you just run the RegEx on the whole document, then all lines will be processed, not stopping after line 100.
So you may need tp select words 1-100 or make the macro select the hundred words and have the macro run on Selected text only.
Or. run the Regex on the complete document, then go back and remove the commas from every hundredth word.
So you may need tp select words 1-100 or make the macro select the hundred words and have the macro run on Selected text only.
Or. run the Regex on the complete document, then go back and remove the commas from every hundredth word.
Hope this was helpful.............good luck,
Bob
Bob
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
http://regex.info/blog/2006-09-15/247
(from the blog of Jeffrey Friedl, the Mastering Regular Expressions man)
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact: