Batch file to Create new data file

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
bmuganda
Posts: 37
Joined: January 18th, 2018, 11:57 am

Batch file to Create new data file

Post by bmuganda »

Hi all,

I have several csdb data files. I would like to write a batch script to extract some fields from the data files and generate into a new data file. Any ideas on how to go about this?


Thanks,
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Batch file to Create new data file

Post by Gregory Martin »

You can do this using the Export Data tool. Select which fields that you want to extract and make sure that CSPro is selected as the Export Format. Will this work for you?
bmuganda
Posts: 37
Joined: January 18th, 2018, 11:57 am

Re: Batch file to Create new data file

Post by bmuganda »

Export Tool will work only for one dictionary, however in this case I have I have more than 5 dictionaries, and I would like to various extract fields from the five dictionaries into two combined dictionaries..
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Batch file to Create new data file

Post by Gregory Martin »

One option then is to have the output dictionary as an external dictionary to your batch application and then, for each case:

1) clear(DICT_NAME); This will clear any data in that dictionary.
2) Fill in variables in that dictionary.
3) writecase(DICT_NAME); Output the case.
bmuganda
Posts: 37
Joined: January 18th, 2018, 11:57 am

Re: Batch file to Create new data file

Post by bmuganda »

Thanks Greg,

Seems that's the way to go. Am trying out that.

Thanks
Post Reply