Notepad++ Replace/Editing Help Please!!!

Status
Not open for further replies.
Lol. I'm dead serious. I saw you people know how to do virtually anything. So here's my problem (I'm sorry for being such a noob, I just need some serious help to understand how to do things first).

I need information like this:
Balser Kenneth 1015 Dover Dr Provo.-84604............................801 225-4668
Kenny & Cassie 2181 Cedar Trails Way Eagle Mtn 84005......801 789-6856

To come out like this:
"Balser","Kenneth","1015 Dover Dr","Provo","84604","8012254668"
"Balser","Kenny & Cassie","2181 Cedar Trails Way","Eagle Mountain","84005","8017986856"

I've reached to this point but probably at a much slower path than you smart people, so I'd like the best advice from start to finish rather than from my point to the end:
"Balser Kenneth 1015 Dover Drive,"Provo","84604","8012254668"
"Kenny & Cassie 2181 Cedar Trails Way,"Eagle Mountain","84005","8017896856"

Naturally, I've tried doing everything I can with just finding and replacing all the . to nothing, all the hyphen's to nothing, and then adding spaces and such as ", or something like that - but this is it: I can't make it work. It's too difficult. I'm using Notepad++ and am a serious novice with it.

I'm wondering if anyone can help me find some code that will convert everything just the way I want it - like they did to help the guy out in this post: viewtopic.php?f=20&t=49190. I'm also up to using a process of codes if that's necessary - I just honestly don't know how to do it and I find it pointless to spend as much time as I have trying to figure this stuff out on my own when someone brilliant who already knows how can just comment within 10-20 minutes as to how they would do it and fix everything through their algorithms.

Let me know what you brilliant minds think because I'm having a devil of a time with it - spent over 20 hours thus far trying new things but to no avail. Please give me your best experienced advice. Thanks so much for anyone that helps me, too.
 

molo

Ars Legatus Legionis
14,786
There's no easy way to do it. The "name" and "street address" and "city" fields don't follow any rules. You could get the "name", "zipcode" and "phone number" fields easily enough, but the "address" and "city" are going to run together.

You're going to be editing it by hand, my friend. Also, for this kind of thing, what you really want to use is Perl and regular expressions, not a text editor.
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
Address parsing is not trivial. Especially since your data set seems to have a lot of irregularities. (you're supposed to figure out that the 2nd row has two first names, and thus pull the surname from the previous row? can the character sequence "Mtn" always be expanded to "Mountain"?) I don't think you can do it with regex alone.
 
Yeah. I thought as much - it's tough stuff this. Thanks for your replies.

As for my current thing - I can search the city names relatively easily and fix them - search for eagle mtn and have it replaced to ,"Eagle Mountain", in all circumstances compatible.

What I've been doing to separate the surname is adding a " ", before it so that when I import to excel (oh, if you have any way to do this in excel I can do that too) it'll be it's own field and I'll just be able to copy paste down the line to it.

Any ideas on how I could get this type of information - much like a phone book - from the OCR I'm using to excel with the Categories: Last Name, First Name, Address, City, Zip, Phone? That's the goal but I've come to nothing.

I can separate with my OCR to tables in excel but it doesn't split up the names or addresses either (or the zips for that matter).

This is honestly just a tough thing it seems. Thanks a bunch for you guys help - if you want to quit on it I'm completely fine with that, too - but if you find it a challenge I would sincerely appreciate your help.
 
Status
Not open for further replies.