D
D
Dmitry Toropov2021-03-20 21:17:52
Notepad++
Dmitry Toropov, 2021-03-20 21:17:52

How to swap certain lines in Notepad++?

Hello.
Tell me how to change certain lines in places? or move up certain rows?

Example:
"first_name": "Kristina",
"id": 535432535,
"last_name": "Surikova",
"first_name": "Anastasia",
"id": 234532453,
"last_name": "Talyzina",
"first_name": "Christina",
"id": 2435325334,
"last_name": "Volkova",

Lines containing "first_name" and "id" should be swapped. How to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2021-03-20
@dmitry_toropov

Find: (?-s)("first_name".+)(\R)("id".+)
Replace: $3$2$1
https://regex101.com/r/nSE3Dh/1

A
Alexander, 2021-03-20
@ForestAndGarden

  1. Hands. Cut and paste operations in Notepad++ have not been canceled.
  2. Search and replace using regular expressions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question