获取以相同字符开头的行

时间:2017-11-22 16:42:50

标签: regex

I have a file that looks like this:

    acquaintances       Bekanta
    acquaintances       Bekant
    acquaintances       Bekanting
    acquaintances       Bekantskap
    acquaintances       Umgängesvän
    acquaintances       vänkrets
    acquaintances       vänkretsen
    adoption        Adoption
    adoption        Adoptionen
    adoption        Adoptioner
    adoption        Adoptering
    ...

and I want to make it look like this:

acquaintances:      Bekanta
                    Bekant
                    Bekanting
                    Bekantskap
                    Umgängesvän
                    vänkrets
                vänkretsen
adoption:       Adoption
                Adoptionen
                Adoptioner
                Adoptering

(不同的缩进是故意的)

我一直在试图弄清楚如何选择以新单词开头的行并替换它们。这是我得到的结果,但它不起作用:

Find:
^(.*?)  (.*?)   (.*?)
\1  (.*?)   (.*?)

Replace:
$1  $2  $3
    $4  $5

0 个答案:

没有答案