Batch to fix and correct duplicate ID
Posted: August 27th, 2015, 9:19 pm
Dear all,
This message is already posted on the forum.
Thanks for your precious help!
I've several files with duplicate ID and i would like to know if there's a way to write a batch program for re-assign ID number, so avoid duplicate.
I know it's not so easy but Cspro developer team, mainly Josh and Gregory always have solution for any sophisticated request.
@ Joshua, my first and simplest idea is to use the same logic you send to me last day within a batch function, something like this after concatenating whole files.
// Start at first case in the data file
locate(MYEXTERNALDICT_DICT, >=, "");
// Loop through all cases
// until loadcase returns zero when it hits end of file.
while loadcase(MYEXTERNALDICT_DICT) <> 0 do
// Increment ID
if ID_MYEXTERNALDICT_DIC >1 then //1 because we don't need to increment the first ID
ID_MYEXTERNALDICT_DIC = visualvalue(ID_MYEXTERNALDICT_DIC) + 1;// Whatever the ID number, increment ID using previous number
endif;
enddo;
I know it's not possible within Csentry, does my idea is realistic using a batch?
Thanks in advance!
This message is already posted on the forum.
Thanks for your precious help!
I've several files with duplicate ID and i would like to know if there's a way to write a batch program for re-assign ID number, so avoid duplicate.
I know it's not so easy but Cspro developer team, mainly Josh and Gregory always have solution for any sophisticated request.
@ Joshua, my first and simplest idea is to use the same logic you send to me last day within a batch function, something like this after concatenating whole files.
// Start at first case in the data file
locate(MYEXTERNALDICT_DICT, >=, "");
// Loop through all cases
// until loadcase returns zero when it hits end of file.
while loadcase(MYEXTERNALDICT_DICT) <> 0 do
// Increment ID
if ID_MYEXTERNALDICT_DIC >1 then //1 because we don't need to increment the first ID
ID_MYEXTERNALDICT_DIC = visualvalue(ID_MYEXTERNALDICT_DIC) + 1;// Whatever the ID number, increment ID using previous number
endif;
enddo;
I know it's not possible within Csentry, does my idea is realistic using a batch?
Thanks in advance!