When we use File->Import ASCII<\/strong> to import data, we can choose import file format using one pre-defined import format definitions. As it is explained in the manual (http:\/\/www.amibroker.com\/guide\/d_ascii.html<\/a>) it is also possible to create our custom import definitions to match data we are trying to import. This article explains all the required steps.<\/p>
For example if we have file with categories like this:<\/p>
\"DDD\",\"3D Systems Corporation\",\"Technology\",\"Computer Software: Prepackaged Software\",1\r\"MMM\",\"3M Company\",\"Health Care\",\"Medical\/Dental Instruments\",1\r\"WBAI\",\"500.com Limited\",\"Consumer Services\",\"Services-Misc. Amusement & Recreation\",1\r\"WUBA\",\"58.com Inc.\",\"Technology\",\"Computer Software: Programming, Data Processing\",1\r\"AHC\",\"A.H. Belo Corporation\",\"Consumer Services\",\"Newspapers\/Magazines\",1\r\"ATEN\",\"A10 Networks, Inc.\",\"Technology\",\"Computer Communications Equipment\",1\r\"AIR\",\"AAR Corp.\",\"Capital Goods\",\"Aerospace\",1\r\"AAN\",\"Aaron's, Inc.\",\"Technology\",\"Diversified Commercial Services\",1<\/pre>We need to add the following commands in the “Additional commands” field of Import Wizard<\/p>
$FORMAT Ticker,FullName,SectorName,IndustryName,Group\r$OVERWRITE 1\r$CLEANSECTORS 1\r$SORTSECTORS 1<\/pre>First line tells AmiBroker the column meaning, second line tells it to overwrite existing data. Last two lines tell AmiBroker to wipe existing category structure and sort imported sectors alphabetically. Be sure NOT to specify $CLEANSECTORS command when you do NOT want to wipe existing category structure.<\/p>
We also need to mark “No quotation data” box in the second page of Import wizard to tell AmiBroker that the file that we are importing does not contain quotes and it should switch off all price checking.<\/p>
<\/p>
Finally, in the last step of the wizard save the format definition:<\/p>
<\/p>
Once we do this, next time we use File->Import ASCII<\/strong> a new selection My own format<\/strong> will appear in the Files of type<\/strong> combo box in the file selector dialog.<\/p>
<\/p>
It is worth noting that import definitions are plain text files that are stored in “Formats” subfolder of AmiBroker directory, and the list of available import definitions that appears in “Files of type” combo box, is also a plain text file called “import.types” that is located in the same subfolder. So, advanced users may also modify those files directly using plain text editor such as Notepad. It is all explained in great detail in the manual http:\/\/www.amibroker.com\/guide\/d_ascii.html<\/a><\/p>","protected":false},"excerpt":{"rendered":"