Page 1 of 1

Tool function to convert .dat to .csdb on android

Posted: July 17th, 2025, 5:58 pm
by segxy4manu
Good day folks
Please, I am seeking for a simple function that can be used on android to convert my .dat file to .csdb
I am using a function of sync function but all my data are being collected in .dat format,
is there any tool in the app to use at the android environment to convert the data file to .csdb so, it can show the output of sync function by displaying cases that have been sent to the server and data that has not been sent
Any supportive app can will also be appreciated

Thanks
'Segun

Re: Tool function to convert .dat to .csdb on android

Posted: July 22nd, 2025, 9:54 am
by Gregory Martin
The easiest way to convert data is to use the Concatenate Data tool. While the tool is designed to concatenate multiple data files, you can also run it on one file. Your input file will be the .dat file and your output will be a .csdb file. You can run production concatenations on Android:

https://www.csprousers.org/help/CSConca ... nates.html

You can also do this in logic with the fileconcat function:

https://www.csprousers.org/help/CSPro/f ... ction.html

If you are going to sync data multiple times, the above approaches have an issue because sync relies on unique case UUIDs, and each time you convert your data, you will get unique case UUIDs because text data files don't use UUIDs so a new one will always be created. This means that you will end up with duplicate cases on the server.

Is there a reason you cannot initially collect data in the CSPro DB format?

Re: Tool function to convert .dat to .csdb on android

Posted: July 24th, 2025, 1:42 pm
by segxy4manu
Yes, I would have done that using csdb, but the menu function and data collection approach was a DHS standard in which the household data is collected before sharing with the other interviewers to start the individual interviews.

at the supervisor tablet, I wrote a script to track all data synch (the sync data function to track how many cases has been sent) but the sync function cannot work with .dat file but with .csdb.

I hope i can get a function to help check in .dat if possible to know how many cases were submitted .

Re: Tool function to convert .dat to .csdb on android

Posted: September 4th, 2025, 7:09 pm
by jodapecol
Buenas
La función que puedes utilizar en Android para convertir *. csdb a *. dat o viceversa es reformat.
Lo lleguƩ a utilizar y funciona bastante bien.

Re: Tool function to convert .dat to .csdb on android

Posted: October 21st, 2025, 11:59 am
by odette.robleto
aca te dej una funcion que desde android puede concatenar los dat
function Concatenar()
string archivosconC,archivoCon;

if fileexist(".\Datos\*.dat") then

archivosconC=".\Datos\*.dat";
archivoCon=".\Concatenados\Datos.csdb";

numeric r=fileconcat(archivoCon,archivosconC);

if !r then errmsg("no concatenado")endif;//reenter CODIGOUSUARIO_1; endif;
errmsg("......CONCATENADO");
else
errmsg("no encontrado");
endif;

end;