Batch replace and fields in reverse order

General discussions about Advanced Find and Replace
Post Reply
judge
Posts: 4
Joined: Sun Apr 03, 2005 12:17 pm
Location: Australia

Batch replace and fields in reverse order

Post by judge »

I have a csv file with fields specified in reverse order and I would like to import it into the Batch Replace feature of afr. Can afr be used to reorder the fields in a single step? If not, what other program can I use? Thanks.

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Post by Abacre »

Hi,

So what do you want to do?
1. Load your csv file into batch grid of AFR

or

2. Your task is to change order of fields into reserve order in csv
file.
Lets consider the second variant, for example you have file consisting
of 3 fields:

field1-1,field2-1,field3-1
field1-2,field2-2,field3-3
field1-3,field2-3,field3-3

What you want is the following file:
field3-1,field2-1,field1-1
field3-3,field2-2,field1-2
field3-3,field2-3,field1-3

So go to Batch replace, check on "Use regular expressions"
put into search for:
(.+),(.+),(.+)\r\n

and into Replace with:
$3,$2,$1\r\n
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

judge
Posts: 4
Joined: Sun Apr 03, 2005 12:17 pm
Location: Australia

Post by judge »

Thank you for your quick response. I was able to follow your instructions about regular expressions and solve my problem.

Post Reply