Page 1 of 1

delete and change places for fields

Posted: Sun Oct 31, 2010 8:08 pm
by zvior
Hi,

I'm a newbie and I wonder if there is a way to transform this file:

(field1) (field2) (field3) (field4) (field5) (field6) (field7) (field8)
20100720 1873041.88 1261 1274.53 1261.65 1258.85 0.92% 1270.38
20100720 2356955.66 1165.36 1175.46 1167.35 1161.72 -0.81% 1171.16
20100720 483913.78 886.90 894.33 893.84 881.17 0.65% 886.90
20100720 73733.36 450.40 454.82 453.67 451.81 -0.49% 454.01
20100720 105651.88 952.72 959.62 957.15 953.60 0.42% 957.59
20100720 167190.77 237.33 240.17 239.15 234.84 -1.06% 237.33
20100720 28395.36 968.35 978.37 975.17 968.33 0.84% 976.49
20100720 430359.13 1206.85 1215.66 1212.14 1204.22 0.41% 1209.20
20100720 113647.33 333.54 337.91 336.26 333.42 1.06% 336.97
20100720 389222.16 1262.13 1275.18 1262.16 1258.32 0.99% 1270.80
20100720 196605.79 284.58 287.27 285 281.85 1.06% 284.85

to that file:

(field1) (field8) (field4) (field3) (field5) (field2)
20100720 1270.38 1274.53 1261 1261.65 1873041.88
20100720 1171.16 1175.46 1165.36 1167.35 2356955.66
20100720 886.90 894.33 886.90 893.84 483913.78
20100720 454.01 454.82 450.40 453.67 73733.36
20100720 957.59 959.62 952.72 957.15 105651.88
20100720 237.33 240.17 237.33 239.15 167190.77
20100720 976.49 978.37 968.35 975.17 28395.36
20100720 1209.20 1215.66 1206.85 1212.14 430359.13
20100720 336.97 337.91 333.54 336.26 113647.33
20100720 1270.80 1275.18 1262.13 1262.16 389222.16
20100720 284.85 287.27 284.58 285 196605.79

Thanx,
Zvi

Posted: Sun Oct 31, 2010 9:12 pm
by ben_josephs
Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: ^([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)
Replace with: \1 \8 \4 \3 \5 \2

[X] Regular expression

Replace All

Posted: Sun Oct 31, 2010 10:44 pm
by zvior
Thank you - it works like a charm!