$variable = "..ADDRESS 1 OR 2"; # here you'll need to assign the variable
perl will check to see if it's address 1 or address 2 from the file.
if ($variable eq "..ADDRESS 1" ) {
    s/\#/Apt/g; # subs # for "Apt"
    s/\(//g; # removes (
    s/\)//g; # removes )
}

some clever regex expert may be able to do this in 1 line, but since i dunno
much about regex, it's still possible in 3 lines, just like that.

"Zary Necheva" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> How can I substitute  "# " or "( "  or  " )"  with some text for ex
>
> Old File:
> ..ADDRESS 1. |a2112 N. ( Charles St.) #199 B
> ..ADDRESS 2. |a2112 N. Pulaski St.
> ..ADDRESS 1. |a2112 N. Pulaski Street #33
> ..ADDRESS 2. |a2112 N. ROSEDALE STREET
> ..ADDRESS 1. |a2112 N. (Smallwood Street)
> ..ADDRESS 2. |a2112 Orleans St. #45
> ................
>
> New File
> ..ADDRESS 1. |a2112 N. Charles St. Apt  199 B
> ..ADDRESS 2. |a2112 N. Pulaski St.
> ..ADDRESS 1. |a2112 N. Pulaski Street  Apt 33
> ..ADDRESS 2. |a2112 N. ROSEDALE STREET
> ..ADDRESS 1. |a2112 N. Smallwood Street
> ..ADDRESS 2. |a2112 Orleans St. #45
> .........
> I have to substitute only that line that starts with ".ADDRESS 1. |a"
>
> Thanks.
>
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to