Formatting Names and Addresses

I have to import names and addresses that have already been created
without any validation.

Does anyone know if there exists a standard/utility/bit of code etc
that does the formatting automatically. Using titleize is a start,
but there are obviously lots of additional formatting requirements
such as Initials in caps etc.

I know this is not strictly Rails, but it is for a rails project and I
couldn’t think of another forum that I could pose this question on.

Tonypm

I have to import names and addresses that have already been created
without any validation.

Does anyone know if there exists a standard/utility/bit of code etc
that does the formatting automatically. Using titleize is a start,
but there are obviously lots of additional formatting requirements
such as Initials in caps etc.

I know this is not strictly Rails, but it is for a rails project and I
couldn’t think of another forum that I could pose this question on.

If they are US based addresses the USPS has a validate/adjustment
service. No idea what it costs, but marketers use it to clean up there
data. Good chance someone has written a ruby library to work with it.

Names are harder… For every rule you come up with I’m sure I can
think of a name that violates it… I don’t see any way to distinguish
between ‘DiMarco’ and ‘Dimarco’. Is the first a typo? Not always…

Good luck!

tonypm wrote in post #950161:

I have to import names and addresses that have already been created
without any validation.

Does anyone know if there exists a standard/utility/bit of code etc
that does the formatting automatically. Using titleize is a start,
but there are obviously lots of additional formatting requirements
such as Initials in caps etc.

I know this is not strictly Rails, but it is for a rails project and I
couldn’t think of another forum that I could pose this question on.

Would the Snail gem help?

Tonypm

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Would the Snail gem help?

Thanks Marnen, looks like it may be of use, or at least a starting
point.
I’ll play with it and see

Thanks
Tonypm

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs