Search replace doubt
am 01.02.2008 18:58:45 von Anup V
Hi,
I hav got a text file with contents
jkfsflkfd ;
lsfjsdlflf ;
kjsflkfds ;
lksjfdkjf ;
i need to replace all ; with some text (containing characters also)
does tr work??
Thanks in advance
Re: Search replace doubt
am 01.02.2008 19:05:49 von Cyrus Kriticos
varkey@changingideas.com wrote:
>
> I hav got a text file with contents
>
> jkfsflkfd ;
> lsfjsdlflf ;
> kjsflkfds ;
> lksjfdkjf ;
>
>
> i need to replace all ; with some text (containing characters also)
>
> does tr work??
no.
sed "s/;/some text/" textfile
--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Re: Search replace doubt
am 01.02.2008 19:11:02 von Allodoxaphobia
On Fri, 01 Feb 2008 19:05:49 +0100, Cyrus Kriticos wrote:
> varkey@changingideas.com wrote:
>>
>> I hav got a text file with contents
>>
>> jkfsflkfd ;
>> lsfjsdlflf ;
>> kjsflkfds ;
>> lksjfdkjf ;
>>
>>
>> i need to replace all ; with some text (containing characters also)
>>
>> does tr work??
>
> no.
>
> sed "s/;/some text/" textfile
And, no, _THAT_ doesn't work either!
$ sed "s/;/some text/g" textfile
Used the "g" because the OP said "all ;"....
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts:
Re: Search replace doubt
am 01.02.2008 19:41:03 von Cyrus Kriticos
Allodoxaphobia wrote:
> On Fri, 01 Feb 2008 19:05:49 +0100, Cyrus Kriticos wrote:
>> varkey@changingideas.com wrote:
>>> I hav got a text file with contents
>>>
>>> jkfsflkfd ;
>>> lsfjsdlflf ;
>>> kjsflkfds ;
>>> lksjfdkjf ;
>>>
>>>
>>> i need to replace all ; with some text (containing characters also)
>>>
>>> does tr work??
>> no.
>>
>> sed "s/;/some text/" textfile
>
> And, no, _THAT_ doesn't work either!
>
> $ sed "s/;/some text/g" textfile
>
> Used the "g" because the OP said "all ;"....
The OP said "all ;" but the "g" is not necessary.
--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Re: Search replace doubt
am 01.02.2008 20:52:34 von Allodoxaphobia
On Fri, 01 Feb 2008 19:41:03 +0100, Cyrus Kriticos wrote:
> Allodoxaphobia wrote:
>> On Fri, 01 Feb 2008 19:05:49 +0100, Cyrus Kriticos wrote:
>>> varkey@changingideas.com wrote:
>>>> I hav got a text file with contents
>>>>
>>>> jkfsflkfd ;
>>>> lsfjsdlflf ;
>>>> kjsflkfds ;
>>>> lksjfdkjf ;
>>>>
>>>> i need to replace all ; with some text (containing characters also)
>>>>
>>>> does tr work??
>>> no.
>>>
>>> sed "s/;/some text/" textfile
>>
>> And, no, _THAT_ doesn't work either!
>>
>> $ sed "s/;/some text/g" textfile
>>
>> Used the "g" because the OP said "all ;"....
>
> The OP said "all ;" but the "g" is not necessary.
'Twould be if there are 2 ";" on a line.
Jonesy