V
V
Victor2015-05-14 23:06:39
Regular Expressions
Victor, 2015-05-14 23:06:39

Every two words in the line are regular expressions and unix. How?

Please help me write a regular expression that selects every two words and uses the sed command to move them to the next line.
I wrote an example for one word, of course I understand that this is a kindergarten, I just haven’t come across them yet.
\n will be inserted after each word followed by a space. Thus, when displayed, it will be on the next line.
sed 's/ /\n/g' mytext.txt

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nektobit, 2015-05-19
@davinctor

I don’t know exactly how to achieve this in niks, but a regular expression that will split words into pairs: [a-z]+\s[a-z]+
Although judging by the date you have already found the answer to your question)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question