Page 1 of 1
Search from column x to column y
Posted: Mon Oct 25, 2010 7:57 pm
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!
Posted: Mon Oct 25, 2010 9:18 pm
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
Posted: Mon Oct 25, 2010 10:26 pm
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?
Posted: Mon Oct 25, 2010 10:42 pm
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
Posted: Fri Oct 29, 2010 3:03 pm
by karipay
Thanks Ben!!! This worked perfectly!!!