Search from column x to column y

General questions about using TextPad

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

Post Reply
karipay
Posts: 12
Joined: Thu Feb 05, 2009 10:26 pm

Search from column x to column y

Post by karipay »

Is this possible in textpad?

Most of my data in column 120 to 150 in my file contains spaces. Just want to delete these 30 bytes/spaces basically moving column 151 as the new COLUMN 120 for the affected rows.

I don't want to do a block mode select since I don't want to lose some of the rows that contains data.

TIA!
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

"Column 120 to 150" and "moving column 151 as the new COLUMN 120" imply 31 characters, not 30.

Assuming 31 is correct:
Find what: ^(.{119}).{31}
Replace with: \1

[X] Regular expression

Replace All
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
karipay
Posts: 12
Joined: Thu Feb 05, 2009 10:26 pm

Post by karipay »

Thanks for the quick reply Ben!

It worked for all of the rows/records, basically removing col. 120-150.

But is there a way to skip the row or record if data is present in the original 120-150 cols?
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Do you mean you want to remove those columns only if they are all spaces?

If so, try
Find what: ^(.{119})_{31} [Replace the underscore with a space]
Replace with: \1

[X] Regular expression

Replace All
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
karipay
Posts: 12
Joined: Thu Feb 05, 2009 10:26 pm

Post by karipay »

Thanks Ben!!! This worked perfectly!!!
Post Reply