Page 1 of 1

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

Posted: Mon Apr 23, 2012 8:41 pm
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

Posted: Mon Apr 23, 2012 9:22 pm
by ben_josephs
Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax

Posted: Mon Apr 23, 2012 9:32 pm
by axg275
Yes, what do I do then?

Thanks in advance!

Posted: Mon Apr 23, 2012 9:41 pm
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

Posted: Mon Apr 23, 2012 9:44 pm
by axg275
I get an error " Cannot Find Regular Expression:"

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

Am I doin something wrong?

Posted: Mon Apr 23, 2012 9:50 pm
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

Posted: Mon Apr 23, 2012 9:50 pm
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.

Posted: Mon Apr 23, 2012 9:54 pm
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

Posted: Mon Apr 23, 2012 9:57 pm
by ben_josephs
Find what: ^([^ ]+ +)([^ ]+ +)([^ ]+ +)
Replace with: \1\2

[X] Regular expression

Replace All

Posted: Mon Apr 23, 2012 10:00 pm
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

Posted: Mon Apr 23, 2012 10:03 pm
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

Posted: Mon Apr 23, 2012 10:04 pm
by ben_josephs
Carrots? Carets, perhaps!

Posted: Wed Apr 25, 2012 2:29 pm
by ben_josephs
Did it work?