Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Cleaning Data Between Specified Columns

by enoch (Chaplain)
on Jan 27, 2003 at 22:17 UTC ( #230370=note: print w/ replies, xml ) Need Help??


in reply to Re: Cleaning Data Between Specified Columns
in thread Cleaning Data Between Specified Columns

++BrowserUK!

I was bitten by my squashing of apostrophes. Because it was a fixed width file, squashing the apostrophes caused the width's to change. I changed the regex to:

s/(.)'(.\B*)/$1$2 /g
So, that spacing was added for each apostrophe I pulled from any field.

enoch


Comment on Re: Re: Cleaning Data Between Specified Columns
Download Code
Replies are listed 'Best First'.
Re: Re: Re: Cleaning Data Between Specified Columns
by BrowserUk (Pope) on Jan 27, 2003 at 22:26 UTC

    In that case, there's no need for this line

    $tmpString =~ s/(.)'(.)/$1$2/g; # squash apostrophes

    As the next line

    $tmpString =~ tr/a-zA-Z0-9\n\|\-/ /c; # remove bad characters

    will convert them to spaces anyway?


    Examine what is said, not who speaks.

    The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

      No, could't do that because I need apostrophe's squashed. For example, I need O'Connor to become OConnor and not O Connor. However, I did need something like you@you.com to become you you.com.

      Weird requirements, I know. I am going to play around with what Fletch did here and see what I can come up with.

      Thanks, everyone,
      enoch

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://230370]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2015-07-28 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls