Merge 2 dictionnaries

Discussions about CSEntry
Post Reply
htuser
Posts: 632
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Merge 2 dictionnaries

Post by htuser »

Dear all,
I would like to know if it's possible to merge 2 dictionnaries into one (as concat do for files).
Thanks in advance,
G.VOLNY, a CSProuser from Haiti, since 2004
manojsoni
Posts: 23
Joined: November 22nd, 2012, 11:55 pm
Location: Jaipur, India

Re: Merge 2 dictionnaries

Post by manojsoni »

Hi

If both the dictionaries have same ids then it can be done

Just cut and paste the records from the one dictionary to second.

Manoj
htuser
Posts: 632
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Merge 2 dictionnaries

Post by htuser »

Thank you Manoj. But i would like to find a way to do it automatically in the event of multiples dictionnaries (as the concat tools do it for severals data file).
Regards,
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Merge 2 dictionnaries

Post by Gregory Martin »

There's no way to automatically merge dictionaries because the header information in a dictionary can only appear once. If you concatenated three dictionaries together, you would have three header sections and three ID sections, which would be problematic. You could write code to read dictionaries two, three, etc. and only copy the data that occurs after the first [Record] entry. That would successfully combine dictionaries in most circumstances.
Post Reply