I am trying (without success) to delete all text other than the tildes ~ after LastName and up to ZZEND
So
FirstName~LastName~Japanese~Jap-X~5~No Body~S1~C1~COMMENT~Barghout~Fullname~ZZEND
Would be rewritten as
FirstName~LastName~Japanese~~~~~~~~~ZZEND
FirstName and LastName are all different and of different length.
I have have a bunch of these to do.
Thank you for creating AFR (it has saved me hundreds of hours) and for any help you extend on this question.
Remove irregular text between delimiters leaving some text.
-
- Posts: 4
- Joined: Thu Sep 28, 2006 4:37 am
Go to main menu - Action - Options - Batch Replace
uncheck "Modifier S"
Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
(.+)~(.+)~Japanese~.+~.+~.+~.+~.+~.+~.+~.+~ZZEND
Replace with:
$1~$2~Japanese~~~~~~~~~ZZEND
Explanations:
.+ means any non empty text.
with () with put found text into $1, then into $2. We use it to store
first name and last name.
Should also Japanese be variable text?
Then you should use:
Search for:
(.+)~(.+)~(.+)~.+~.+~.+~.+~.+~.+~.+~.+~ZZEND
Replace with:
$1~$2~$3~~~~~~~~~ZZEND
That's all I verified it works perfectly.
uncheck "Modifier S"
Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
(.+)~(.+)~Japanese~.+~.+~.+~.+~.+~.+~.+~.+~ZZEND
Replace with:
$1~$2~Japanese~~~~~~~~~ZZEND
Explanations:
.+ means any non empty text.
with () with put found text into $1, then into $2. We use it to store
first name and last name.
Should also Japanese be variable text?
Then you should use:
Search for:
(.+)~(.+)~(.+)~.+~.+~.+~.+~.+~.+~.+~.+~ZZEND
Replace with:
$1~$2~$3~~~~~~~~~ZZEND
That's all I verified it works perfectly.
-
- Posts: 4
- Joined: Thu Sep 28, 2006 4:37 am
Thank you.
Thank so much. It does work perfectly. It is elegant. Thank you for the explaination, too. AFR is so powerful and it is enjoyable to learn how to take advantage of some of what you have built into it.
Ray
Ray