I have a pipe delimited file with data that looks like this
ERFSYS1064|0718900798|1|S|2010-01-21 07:31:00
ERFSYS1032|0719600582|1|S|2010-02-17 11:00:00
ERFSYS1025|0719600582|1|S|2010-02-17 11:00:00
ERFSYS1025|0720801347|1|L|2010-01-18 16:30:00
ERFSYS1032|0722501524|1|S|2010-01-25 14:13:00
ERFSYS1025|0723000269|1|S|2010-01-17 11:00:00
I need to re-order the fields to look like this
0718900798|S|ERFSYS1064|1|2010-01-21 07:31:00
0719600582|S|ERFSYS1032|1|2010-02-17 11:00:00
0719600582|S|ERFSYS1025|1|2010-02-17 11:00:00
0720801347|L|ERFSYS1025|1|2010-01-18 16:30:00
0722501524|S|ERFSYS1032|1|2010-01-25 14:13:00
0723000269|S|ERFSYS1025|1|2010-01-17 11:00:00
Thanks
Steve
How can I re-Order fields in pipe delimited file?
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Ben,ben_josephs wrote:Use "Posix" regular expression syntax:Search | Replace... (<F8>):Configure | Preferences | Editor
[X] Use POSIX regular expression syntaxFind what: ([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)
Replace with: \2|\4|\1|\3|\5
[X] Regular expression
Replace All
I tried this and I get a "Cannot find regular expression" popup
UPDATE: I found the problem - I had a newline /n at the end.
Thanks again
Steve