Thank you. But as you said,some cmap names are not mapped to PubChem CID well. This is the key point. In pubchem ftp, there is a file CID-Synonym-filtered, which show the relationship between CID and drug synonym name. but the cmap names are special sometimes. Once getting all the CID of cmap name, it's easy to obtain the structual file.
cmap name: The name given to a perturbagen (or group of closely related perturbagens) by cmapcurators. For small molecules, the cmap name is always the recommended ('r') or provisional ('p') INN, if one is available. Otherwise a cmap name is selected from amongst the United States Adopted Name (USAN), the British Approved Name (BAN), the monograph titles from Martindale: The Complete Drug Reference or The Merck Index. Different salts of the same compound are given the same cmap name, unless a specific salt is the INN. For example, the cmap name for both propiomazine hydrochloride and propiomazine maleate is "propiomazine" (which is the rINN) but the cmap name for isosorbide dinitrate is "isoborbide dinitrate" since this is the rINN.
Source: http://www.broadinstitute.org/cmap/help_topics_frames.jsp
It would make everyones life easier if Connectivity Map became a PubChem submitting source (anyone from that crew listening?) then the mappings are taken care of and advanced analysis becomes possible inside PubChem (e.g. exactly which ones are in cmap and/or/not DrugBank
Anyone from the cmap team actually following this post?
I mailed the cmap-help, buy no reply so far.