Need Help! - Trying to delete a column in a text document

General questions about using TextPad

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

Post Reply
axg275
Posts: 6
Joined: Mon Apr 23, 2012 8:37 pm

Need Help! - Trying to delete a column in a text document

Post by axg275 »

Hi All,

I am stuck. I have a text file with 410K rows and 4 columns. I want to delete 3rd column and I dont know how to do this.

04/18/2012 06:00:00 1 14.65

Above the the data the way it looks like for all 410K records. Is it possible for me to select just the 3rd column and remove it?

I have been browsing this forum and found something similar to what I am trying to do but its not working for me. The post is

http://forums.textpad.com/viewtopic.php ... ght=column

But when I try to replace (.*)\ with \3 its not working.

Can you guys help me out, I really need to get this data fixed.

Thank you, I really appreciate your help
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
axg275
Posts: 6
Joined: Mon Apr 23, 2012 8:37 pm

Post by axg275 »

Yes, what do I do then?

Thanks in advance!
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

I thought you'd worked it out from the other post you referred to.

Try this:
Find what: ^([^ ]+) ([^ ]+) ([^ ]+)
Replace with: \1 \2

[X] Regular expression

Replace All
axg275
Posts: 6
Joined: Mon Apr 23, 2012 8:37 pm

Post by axg275 »

I get an error " Cannot Find Regular Expression:"

when I search for ^([^ ]+) ([^ ]+) ([^ ]+)

Am I doin something wrong?
axg275
Posts: 6
Joined: Mon Apr 23, 2012 8:37 pm

Post by axg275 »

I really dont know what I am doing.... I am sorry, i am really brand new to textpad.

04/18/2012 06:00:00 1 14.65

This is my data

I want it to look like

space between date and time and tab between time and pressure

04/18/2012 06:00:00 14.65

I really appreciate your help
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

What separates the columns? I've assumed it's a single space, as that is what is suggested by your sample text.
axg275
Posts: 6
Joined: Mon Apr 23, 2012 8:37 pm

Post by axg275 »

sir,

the fist column is separated by what looks like 4 spaces second from third by 7 spaces and 3rd to 4th by 7 spaces


Thank you
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: ^([^ ]+ +)([^ ]+ +)([^ ]+ +)
Replace with: \1\2

[X] Regular expression

Replace All
axg275
Posts: 6
Joined: Mon Apr 23, 2012 8:37 pm

Post by axg275 »

:( still not working same error message.

Can you tell me what these carrots and plus signs mean maybe I can understand what I am doing wrong?

Thank you very much
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Ah. I see you added a post saying there are tabs there. Try this:
Find what: ^([^ \t]+[ \t]+)([^ \t]+[ \t]+)([^ \t]+[ \t]+)
Replace with: \1\2

[X] Regular expression

Replace All
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Carrots? Carets, perhaps!
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Did it work?
Post Reply