From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Angus Comber Newsgroups: gmane.emacs.help Subject: Re: emacs regex to transform text of field1\nfield2\n into field1\tfield2\n etc Date: Sat, 16 Feb 2019 11:51:05 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253792"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs Help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 16 12:53:32 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guyXE-0013vG-Da for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Feb 2019 12:53:32 +0100 Original-Received: from localhost ([127.0.0.1]:55073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guyXD-0006Xu-46 for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Feb 2019 06:53:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guyWt-0006Xn-9s for help-gnu-emacs@gnu.org; Sat, 16 Feb 2019 06:53:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guyWr-0002zo-MT for help-gnu-emacs@gnu.org; Sat, 16 Feb 2019 06:53:11 -0500 Original-Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:37801) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guyWr-0002yB-Bs for help-gnu-emacs@gnu.org; Sat, 16 Feb 2019 06:53:09 -0500 Original-Received: by mail-pl1-x62c.google.com with SMTP id b5so6313573plr.4 for ; Sat, 16 Feb 2019 03:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=IfhKUl+8n5Jv7zFAGu5w9wZz6OTqyU+DaT5rKtZjMb8=; b=Pwa71qdKgMZ/ZGyv+ILv3TkL1gSpIPQ+vK6GceF5O4d7xSn3RDEvBn+skoIqUsAKVO Oy6Xv6fFE1jMxNx2iycyAb/8pUuX1mbnFJcuH43ieOfWIdBIcO3o6MYtW32zRjAhS5GS XoGEegTp6VcOB7zzOZioZW35HPJPhO5W2Uj0qJ+lXUvKHJ8bb6/eCq7quOcKCidhHI+X D8e2IGXdBMQmAYtyQQQTWiEPu+G0+tBzSphUBmzIGaFQYb77paho/4dVtuBTdmkTYsM0 +1e31mQhRc5vnKSUq2aiFrqg18PR14VFRc4hbRg/L0F9f+EZlaCbpEeGg5dfbiXm+hB1 vovA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=IfhKUl+8n5Jv7zFAGu5w9wZz6OTqyU+DaT5rKtZjMb8=; b=f80JAPt0ts9s5s21yxn89Iu1PwDoKn/ACJdLpFtSdOcVOK1XvGav9MjcackuXKEsVY mPzGjsVZ917Tdpk0YUyvmY5aI+KkEWeHOk4ipnGVBNCA3MFlAZBFprsE1fWL8FGNWZgQ Ygvh1snwk8VkBmOUUW8nXVrFvG4hXW8snuVk1duMGYKF6R94zlJQeIWKlkwt71XveHpe QeA8dOA23AScl7bResTlgfDbSsUEYt+yBgK1fXFLrG/nP1uWbz5jqDDzZCXHHNtx3xNQ tszoULjFhj5ZaL6GsLuqkKTJ48x7IpxRGjzjPRTxPAaAsXSFlxSG37YP/5NxiQVOJw4P DBkg== X-Gm-Message-State: AHQUAubgi5mQiDG5bbkyzT15Coflf6X+XEsw/MW4fsw2IPKL0+VhCTzD tXO6liJgxXO3qkhUOQ18MGC4XbDlTTQGaOdin7Xrtg== X-Google-Smtp-Source: AHgI3Ia++lCTBT6iT2cMeSN6Pt0JoBGUKlwlnxajWSF+cbdaGCP8dNs6KCU7Ny+KvY6ReH8JntY8IRgQnS41R+D43wM= X-Received: by 2002:a17:902:7246:: with SMTP id c6mr14776327pll.68.1550317985822; Sat, 16 Feb 2019 03:53:05 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62c X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119431 Archived-At: I worked it out. m-% ^\(.*\) Ctrl-Q newline \(.*\) with \1 \2 On Sat, 16 Feb 2019 at 11:23, Angus Comber wrote: > I have a text file of modem country codes like this: > > T.35 Code > Country > 00 > Japan > 07 > Argentina > 09 > Australia > 0A > Austria > > > But I want to transform the buffer to look like this: > T.35 Code Country > 00 Japan > 07 Argentina > 09 Australia > 0A Austria > > What regex would do that? > >