How can I insert an "......." in a column??? Plea

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
anako
Posts: 5
Joined: Mon May 21, 2007 10:00 pm

How can I insert an "......." in a column??? Plea

Post by anako »

I will like to insert an ascii character, " ", in a file, that has already being created, to all the items between lines 15 and 19. Is that possible? If yes, how can I do this? Please help!!!!!!!!!
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Please provide a sample of before and after.
Hope this was helpful.............good luck,
Bob
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

This is not clear. Please give examples of the text as it is now and as you would like it to be. Enclose your examples in

Code: Select all

[/color][/b] ... [b][color=blue]
[/color][/b] tags (without the space I've added to stop the tags being interpreted), to preserve the layout of the examples.
anako
Posts: 5
Joined: Mon May 21, 2007 10:00 pm

Please help!!!!!

Post by anako »

This is the before file. Note no " " in 4th column.

"Vendor Stk Nbr Item Nbr Item Desc 1 Store Nbr Store Name WM Wee
1201 245505 BLKBEAUT SHEA BTR DP 930 MONTGOMERY, AL 200712
1201 245505 BLKBEAUT SHEA BTR DP 938 MONTGOMERY, AL 200702
1201 245505 BLKBEAUT SHEA BTR DP 949 DALLAS ,TX 200702
1201 245505 BLKBEAUT SHEA BTR DP 961 LA PLACE, LA 200702


This is the file after

Vendor Stk Nbr Item Nbr Item Desc 1 Store Nbr Store Name WM Week
1201 245505 BLKBEAUT SHEA BTR DP 62 "BLYTHEVILLE, AR " 200705
1201 245505 BLKBEAUT SHEA BTR DP 83 "MAGNOLIA, AR" 200705
1201 245505 BLKBEAUT SHEA BTR DP 87 "MINDEN, AR" 200705
1201 245505 BLKBEAUT SHEA BTR DP 448 "SHREVEPORT , LA" 200705
1201 245505 BLKBEAUT SHEA BTR DP 483 "PRATTVILLE, AL" 200705
1201 245505 BLKBEAUT SHEA BTR DP 488 "QUINCY, FL" 200705
1201 245505 BLKBEAUT SHEA BTR DP 539 "ALEXANDRIA, LA" 200705
1201 245505 BLKBEAUT SHEA BTR DP 588 "ALBANY, GA" 200705
1201 245505 BLKBEAUT SHEA BTR DP 707 "CLARKSDALE, MS" 200705
1201 245505 BLKBEAUT SHEA BTR DP 763 "FAIRFIELD, AL" 200705
1201 245505 BLKBEAUT SHEA BTR DP 862 "HINESVILLE, GA" 200705
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

It is not clear that this is the same problem as the one you mentioned in your original post.

You didn't use

Code: Select all

[/color][/b] ... [b][color=blue]
[/color][/b] tags, as I requested, but I managed to extract your examples from the source of this page.

If I understand correctly, you want to put double quotes around the eighth column of your data, where the columns are separated by inconsistent white space, except that the eighth column is everything that isn't one of the first seven columns or the last column (which is all digits). Is that right? If so, this might do what you want:
Find what: ^(([^ \t]+[ \t]+){7})(.+)([ \t]+[0-9]+)
Replace with: \1"\3"\4

[X] Regular expression
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
anako
Posts: 5
Joined: Mon May 21, 2007 10:00 pm

Post by anako »

Thanks for your help. That worked.
Post Reply