Page 1 of 1

Batch replace and fields in reverse order

Posted: Sun Apr 03, 2005 12:27 pm
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.

Posted: Sun Apr 03, 2005 12:52 pm
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

Posted: Sun Apr 03, 2005 3:43 pm
by judge
Thank you for your quick response. I was able to follow your instructions about regular expressions and solve my problem.