How do I insert tabs at various positions in each line of the file: 27, 36, 50, 61, 66, 72, 81, 93, 102, 110, 122
???
Thanks in advance!
Tab Insert Questions
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
Two options.
The first is Block Select Mode. Enable that, go to those columns, highlight the entire column and hit Tab.
The second is via regular expressions. The following expression, where N is any of your numbers (27, 36, etc), could also be run.
Quote:
Find what: ^.{N-1}
Replace with: \0\t
[X] Regular expression
This assumes you are using Posix regular expression syntax:
Quote:
Configuration | Preferences | Editor
[X] Use POSIX regular expression syntax
And one of the regex gurus might offer a different route since as I think about it, that might do funny things with pre-existing tabs.
The first is Block Select Mode. Enable that, go to those columns, highlight the entire column and hit Tab.
The second is via regular expressions. The following expression, where N is any of your numbers (27, 36, etc), could also be run.
Quote:
Find what: ^.{N-1}
Replace with: \0\t
[X] Regular expression
This assumes you are using Posix regular expression syntax:
Quote:
Configuration | Preferences | Editor
[X] Use POSIX regular expression syntax
And one of the regex gurus might offer a different route since as I think about it, that might do funny things with pre-existing tabs.
I choose to fight with a sack of angry cats.
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
Pass #1
Find what: ^.{26}
Replace with: \0\t
Pass #2
Find what: ^.{35}
Replace with: \0\t
etc
The other option would be a one pass deal
Find what: (^.{26})(.{9})(.{14})
Replace with: (\1)\t(\2)\t(\3)
Continue the above find what pattern like (.{}) where the value inside {} is the next position minus the current position, e.g. 50-36 = 14 in the above example
On the replace portion, you will add \t(\NUMBER) where NUMBER is the count of tagged search expressions. Basically, repeat the pattern (\1)\t(\2)\t(\3)\t(\4) for each set of parenthesis you have in your search expression.
The help file under regular expressions can help explain far better about what you are attempting to do.
Find what: ^.{26}
Replace with: \0\t
Pass #2
Find what: ^.{35}
Replace with: \0\t
etc
The other option would be a one pass deal
Find what: (^.{26})(.{9})(.{14})
Replace with: (\1)\t(\2)\t(\3)
Continue the above find what pattern like (.{}) where the value inside {} is the next position minus the current position, e.g. 50-36 = 14 in the above example
On the replace portion, you will add \t(\NUMBER) where NUMBER is the count of tagged search expressions. Basically, repeat the pattern (\1)\t(\2)\t(\3)\t(\4) for each set of parenthesis you have in your search expression.
The help file under regular expressions can help explain far better about what you are attempting to do.
I choose to fight with a sack of angry cats.