Changing order of csv-file entries with regex replacement in Notepad++ -


I'm trying to change the order of * .csv-file entries with Notepad. How the file looks like now:

  ABC; DEF; Here is some long text, .-- In this; truth; wrong; QWE; RTY; Here comes with some long lessons, .-- In this; right; wrong;  

And after finding / changing it should look like this:

  DEF; Here comes some long text, .- ABC; right wrong;; RTY; Here, with some long lessons, .- In this; QWE; truth; wrong ;;  

Then column # 1 should be in # 3 position, column number # 2 and # 3 should be left one

I try so far Key:

I tried to bring the first three columns with a regular expression in the area of ​​finding, putting some brackets around them and reorder them with $ sign in the Replacement area But my rages match almost the whole line, not only the first three Tnb- what I'm doing? Here is my Reggae:

  ([AZ] {3}) \;. ([AZ] {3}) \; (* [^ \;]) \;  

The first two columns and the following ; are selecting properly, the problem will be in the third round bracket but I have no clue what is the problem; the third expression is ; should match everything except that ; Has been terminated by .

The content of the replacement field is $ 2; $ 3; $ 1; , I think that's right.

The main problem is that you use this expression to avoid unnecessary semi-colon ^ (? S) ([AZ] {3};) ([AZ] {3};) ([^ \ n \ r]] *;) and replace it with expression < Code> $ 2 $ 3 $ 1

In the case of line with at least columns, more delimiters than the line \ r or \ n is included. In addition, you should start the string anchor ^ to be safe if you have more columns


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -