Skip to main content

Function or Script

Hi All,
I have a field that contains a list of number separated by (,), what i need is : create a lot of field depended of how number contained in it ,
for ex : 3554249, 3554250, 3554251, 3554252  and the result that i'd like is for ex :

A
B
C
D

3554249
3554250
3554251
3554252

Thank you.

Ahmed Tue, 09/26/2017 - 04:30

Hi Brian,
I execute the script following your recomondation and i get this error message 
Thanks.

Ahmed Tue, 09/26/2017 - 04:34

Hi Brian,
This is the correct snapshot,
Thanks

Brian Element Tue, 09/26/2017 - 06:43

In reply to by Ahmed

Just a couple of questions.  Did it create any additional append files or did it give you the erorr on the first extract?  Second question is all your fields character except for the rate field?  The equation is assuming a character field so if one of your number fields is numeric that would give you this error.

Ahmed Wed, 09/27/2017 - 04:29

Hi Brian,
First point; the script work correctly and yes for the error it was related to the type of field and I changed it from numeric to character. Seconde point; is, I split the database in 3 parts due to the performance of my computer and i was asking if is it possible to add for "Clientclose" after creating each field ?. Last point; that is related to my fault, is I forget to tell you that the field 'Rate' is in position 2 and there another field named 'Country' is in the first field so i would like to include it in the result.
Thank your very much for your helping.
Regards.

Brian Element Wed, 09/27/2017 - 11:58

In reply to by Ahmed

Nope, it is the new one but it only needed a couple of changes to work.  If the for loop it is now a 2 instead of a 1 so it is starting with the third field.  There is a line to close the database db.close and another line to add the second field to the files.

Ahmed Thu, 09/28/2017 - 03:07

I'm sorry Brian, but when I execute the old or the new script that you send to me, I get the same result.
I don't know where's the problem.
 

Brian Element Thu, 09/28/2017 - 06:41

In reply to by Ahmed

Hi Ahmed,

In the latest script do you see these lines in the extractFields() function:

task.AddFieldToInc sFieldNames(0)
task.AddFieldToInc sFieldNames(1)
task.AddFieldToInc sFieldNames(i)

If you don't then you are still using the old script.  Let me know.

Thanks

Brian

Ahmed Thu, 09/28/2017 - 07:25

Hi Brian,
yes it's the old, here's the snapshot;
Thanks.