Deleting multiple cases from CSDB file

Discussions about editing and cleaning data
Post Reply
msoni
Posts: 32
Joined: February 19th, 2024, 11:38 am

Deleting multiple cases from CSDB file

Post by msoni »

Hi and greetings

We are running a survey where around 45 devices being used for data collection and sending data on daily basis on CSWeb server. I download data everyday and process something and prepare data file for analysis.

There are 5 IDs which needs to be deleted as these were test cases.

I need to each time download and make excel output and then delete from the output excel. Is there a way to delete those 5 cases directly from CSDB file and after that, i export to excel.

I read documents which says using delcase function but says works only external dictionary.
Is there some other quick way of doing it within CSDB file ?

Thanks and Regards
Manoj
htuser
Posts: 651
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Deleting multiple cases from CSDB file

Post by htuser »

A few years ago Greg helped me with similar and a worse issue. It was the first and only batch application I ever wrote... :D
a) I created a list string with all the UUIDs of the cases I wanted to delete.
b) And wrote few logic lines in a batch application adding the main dictionary (and related csdb) as external dict.
Please take a look at the attached solutions.
DeleteCasesBatch.zip
(18.26 KiB) Downloaded 433 times
Hope this help.
G.VOLNY, a CSProuser from Haiti, since 2004
msoni
Posts: 32
Joined: February 19th, 2024, 11:38 am

Re: Deleting multiple cases from CSDB file

Post by msoni »

Thanks. Will look into it.
Regards
msoni
Posts: 32
Joined: February 19th, 2024, 11:38 am

Re: Deleting multiple cases from CSDB file

Post by msoni »

Dictionary is missing in attached file.
Please send. Thanks
htuser wrote: January 29th, 2025, 12:29 pm A few years ago Greg helped me with similar and a worse issue. It was the first and only batch application I ever wrote... :D
a) I created a list string with all the UUIDs of the cases I wanted to delete.
b) And wrote few logic lines in a batch application adding the main dictionary (and related csdb) as external dict.
Please take a look at the attached solutions.
DeleteCasesBatch.zip

Hope this help.
htuser
Posts: 651
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Deleting multiple cases from CSDB file

Post by htuser »

You should replace case key or uuid, dictionary and item names with your own and test it.
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply