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
Tool function to convert .dat to .csdb on android
-
segxy4manu
- Posts: 44
- Joined: August 31st, 2016, 5:51 pm
-
Gregory Martin
- Posts: 1946
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Tool function to convert .dat to .csdb on android
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?
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?
-
segxy4manu
- Posts: 44
- Joined: August 31st, 2016, 5:51 pm
Re: Tool function to convert .dat to .csdb on android
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 .
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 .
-
jodapecol
- Posts: 10
- Joined: August 25th, 2017, 9:56 am
Re: Tool function to convert .dat to .csdb on android
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.
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.
-
odette.robleto
- Posts: 5
- Joined: May 8th, 2025, 12:08 am
Re: Tool function to convert .dat to .csdb on android
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;
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;