Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

7 May, 2024: fms is rebuilding. Don't expect much in that section for quite a few days, maybe longer.


devel / comp.unix.shell / Re: removing repeating/duplicate control char

SubjectAuthor
* Re: removing repeating/duplicate control charspender
`- Re: removing repeating/duplicate control charJanis Papanagnou

1
Re: removing repeating/duplicate control char

<tt175u$tptl$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=6017&group=comp.unix.shell#6017

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: spender@yeah.net (spender)
Newsgroups: comp.unix.shell
Subject: Re: removing repeating/duplicate control char
Date: Tue, 21 Feb 2023 09:35:56 +0800
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <tt175u$tptl$1@dont-email.me>
References: <8fa0961c-0ddb-44ab-a2fd-4fa7188b7789@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 21 Feb 2023 01:35:58 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c9bb66b9cdc0c5dd9f72066e9cbf1602";
logging-data="976821"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Uo4DXwv5MzCIF+Kda8UPp"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:c5vGJFbCSCkT0i/kKIP5bXo1x6s=
In-Reply-To: <8fa0961c-0ddb-44ab-a2fd-4fa7188b7789@googlegroups.com>
 by: spender - Tue, 21 Feb 2023 01:35 UTC

在 2013/3/16 3:31, peter sands 写道:
> Hello,
>
> I have a text file where I need to get rid of a repeating control character, I have tried sed and tr but not getting the results I expect.
> The text file is as an example:
>
> ^M
> text here
> text here
> ^M^M
> text here
> text here
> ^M
>
> I need to remove the repeating character of ^M so I have:
>
> ^M
> text here
> text here
> ^M
> text here
> text here
> ^M
>
> Any idea's please
> PS

USE sed command , find and replace: sed -n ':a;N;$!ba;s/\n\r\r\n/\n/g'
filename

Re: removing repeating/duplicate control char

<tt21do$13cnu$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=6018&group=comp.unix.shell#6018

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: removing repeating/duplicate control char
Date: Tue, 21 Feb 2023 10:03:52 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <tt21do$13cnu$1@dont-email.me>
References: <8fa0961c-0ddb-44ab-a2fd-4fa7188b7789@googlegroups.com>
<tt175u$tptl$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 21 Feb 2023 09:03:53 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="81c73a67eab52b0e47547f8ce6e73b4d";
logging-data="1159934"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uF20eD6rAFnZhTgK9RP/Y"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:BevEyTgid3I0iwKfdtbgcXm/rLQ=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <tt175u$tptl$1@dont-email.me>
 by: Janis Papanagnou - Tue, 21 Feb 2023 09:03 UTC

On 21.02.2023 02:35, spender wrote:
> 在 2013/3/16 3:31, peter sands 写道:
^^^^^^^^^^^
>> Hello,
>>
>> I have a text file where I need to get rid of a repeating control
>> character, I have tried sed and tr but not getting the results I expect.
>> The text file is as an example:
>> [...]
>
> USE sed command , find and replace: sed -n ':a;N;$!ba;s/\n\r\r\n/\n/g'
> filename

After these 10 years that passed since his post I suppose that peter
sands could have even carved the duplicate control characters out of
marble using a chisel instead of sed.

Janis

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor