replace single quote to double quote with an example

replace single quote to double quote with an example

Post by Sam Hold » Tue, 22 Dec 1998 04:00:00





Quote:>Sorry this is my second post , I have added an example so you will know what
>do I want to do.

>I have three input fields "$YourAddress" , "$MumAddress" and "$DadAddress" , I
>want to replace all these field's input data from single quote ( ' ) to Double
>quote( " ) . Is it prosible? Could you give me some example?

man tr

--
Sam

You can blame it all on the internet. I do...
        --Larry Wall

 
 
 

replace single quote to double quote with an example

Post by Igor Rafienk » Tue, 22 Dec 1998 04:00:00


| p.s some of the field's data may like this ( 8 ' 54 O'Rally Rd ),
| I want to replace it to ( 8 " 54 O"Rally Rd. )


~$ echo 8 \' 54 O\'Rally Rd | tr \' \"

igorR
--
"Ma belle demoiselle, repondit Candide, quand on est amoureux, jaloux
et fouette par l'Inquisition, on ne se connait plus"
                                Voltaire, "Candide"

 
 
 

replace single quote to double quote with an example

Post by Eric Land » Tue, 29 Dec 1998 04:00:00



> I have three input fields "$YourAddress" , "$MumAddress" and "$DadAddress" , I
> want to replace all these field's input data from single quote ( ' ) to Double
> quote( " ) . Is it prosible? Could you give me some example?

> p.s some of the field's data may like this ( 8 ' 54 O'Rally Rd ),
> I want to replace it to ( 8 " 54 O"Rally Rd. )

In any APL:

     string [ ( string = '''' ) / {iota} {rho} string ] {<-} '"'

In some APLs, even easier:

     ( ( string = '''' ) / string ) {<-} '"'

The above uses ASCII transliteration; the actual characters are:

{iota}: LC Greek iota
{rho}: LC Greek rho
{<-}: left-pointing arrow

Eric Landau, APL Solutions, Inc.
"Sacred cows make the tastiest hamburger" - Abbie Hoffman