ADDING A TAB BETWEEN NUMERS AND LETTERS

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Susan M. Douthart
Posts: 8
Joined: Thu May 14, 2009 6:38 pm
Location: Newtown Square, PA

ADDING A TAB BETWEEN NUMERS AND LETTERS

Post by Susan M. Douthart »

Hello. I am confused about how to add a tab between the 3-digit numbers in the beginning of the second column and the text after it to make the text a third column.

ACCT 610BUDGET AND EXEC CONTA030308089999
ACCT 821CONTROLLERSHIP A030382089999
ACCT 851TAX RESEARCH A030308089999
ACCT 852FIN ACCT THEORY/RES A030308089999
ACCT 853ADV ACCT PROBLEMS A030308089999

Can someone give me some help, please. TX! Susan
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

For the sample you provided:

Search For: ^ACCT ([0-9]{3})
Replace with: ACCT \1\t

=========================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Last edited by Bob Hansen on Fri May 29, 2009 2:14 pm, edited 1 time in total.
Hope this was helpful.............good luck,
Bob
Susan M. Douthart
Posts: 8
Joined: Thu May 14, 2009 6:38 pm
Location: Newtown Square, PA

ADDING A TAB BETWEEN NUMERS AND LETTERS

Post by Susan M. Douthart »

Bummer, Bob, this didn't work. For some reason, it's not finding the numbers to add a tab.

ACCT 610BUDGET AND EXEC CONTA030308089999
ACCT 821CONTROLLERSHIP A030382089999
ACCT 851TAX RESEARCH A030308089999
ACCT 852FIN ACCT THEORY/RES A030308089999

I'm getting an error: Cannot find regular expression '^ACCT ([0-9]{3})'

Am I doing something wrong? Tx, Susan
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Are you sure you have a check mark in Regular Expressions?

Image
Hope this was helpful.............good luck,
Bob
Susan M. Douthart
Posts: 8
Joined: Thu May 14, 2009 6:38 pm
Location: Newtown Square, PA

Post by Susan M. Douthart »

Yep. Not sure how to post a screenprint in here.
Susan M. Douthart
Posts: 8
Joined: Thu May 14, 2009 6:38 pm
Location: Newtown Square, PA

Post by Susan M. Douthart »

I figured out this expression for the entire table, but it only works on a couple of rows:

FIND: ^\([A-Z ]\{3,6\}\)\([0-9]\{3\}\)\([A-Z /]\{20\}\)\([A-Z0-9]\{13\}\)
REPLACE WITH: \1\t\2\t\3\t\4

ACCT 610BUDGET AND EXEC CONT A030308089999
ACCT 821CONTROLLERSHIP A030382089999
ACCT 851TAX RESEARCH A030308089999
ACCT 852 FIN ACCT THEORY/RES A030308089999
BIOL 853ADV ACCT PROBLEMS A030308089999
BIOL 610BUDGET AND EXEC CONT A030308089999
BIOL 821CONTROLLERSHIP A030382089999
BIOL 851TAX RESEARCH A030308089999
BIOL 852 FIN ACCT THEORY/RES A030308089999
CHEMI 853ADV ACCT PROBLEMS A030308089999
CHEMI 610BUDGET AND EXEC CONT A030308089999
CHEMI 821CONTROLLERSHIP A030382089999
CHEMI 851TAX RESEARCH A030308089999
CHEMI 852 FIN ACCT THEORY/RES A030308089999
Susan M. Douthart
Posts: 8
Joined: Thu May 14, 2009 6:38 pm
Location: Newtown Square, PA

Post by Susan M. Douthart »

Sorry to be such a pain in the butt, Bob. I'm still new to this & it's driving me nuts!!! Actually, at this point, that's probably a short putt :roll: :roll:
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Okay, need to modify to handle initial text values, and make the text after the three digits into a third column.....

Search for: ^([A-Z].*_[0-9]{3})
Replace with: \1\t

"_" is representing a space character

Also suggest that you use POSIX syntax with RegEx, it is much easier to read, eliminates many of the escape "\" characters.
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Last edited by Bob Hansen on Fri May 29, 2009 2:19 pm, edited 2 times in total.
Hope this was helpful.............good luck,
Bob
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

You can insert images on the post with the Img button and/or type in the code [img]http://image_url[/img].., Here is a picture of the Img* button. The link must be available on the net, it is not uploaded to this site. There are a couple of free sites to store images, including http://tinypic.com.

Here is a snapshot of the Img* button using tinypic.com:
Image
The actual code is {IMG}http://i39.tinypic.com/1zg876c.jpg{/IMG}
(I have disabled HTML and am using braces "{ }" vs. brackets "[ ]" for display on the forum).

So, take a screen shot, save it as a jpg file, and upload it to tinypic.com site. You can then copy a link from the tinypic.com site and paste it into your posting.
Hope this was helpful.............good luck,
Bob
Post Reply