{"id":561,"date":"2014-10-14T19:16:28","date_gmt":"2014-10-15T00:16:28","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/?p=561"},"modified":"2014-12-03T07:56:08","modified_gmt":"2014-12-03T12:56:08","slug":"how-to-combine-data","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2014\/10\/14\/how-to-combine-data\/","title":{"rendered":"How to combine data from multiple input files"},"content":{"rendered":"
Sometimes it is useful to update existing database with quotes from other source and sometimes we just want to update one data field, leaving other unaffected. For example we may want to import data into Aux1<\/strong> and Aux2<\/strong> fields leaving regular OHLC prices untouched.<\/p> This post will show how to use $HYBRID mode of ASCII importer to combine data from multiple input files.<\/p> When we use Import Wizard \/ Import ASCII features to import quotations, by default the importer expects Close<\/strong> prices to be present in the imported data. There are some situations however when it would be convenient to import data just to one field (e.g. Aux1<\/strong>) if we have some additional values that we want to store in the database.<\/p> Of course, one way would be to combine all these quotes in a single file before the import and process in one run – but ASCII importer allows also to use special $HYBRID mode to import such partial data.<\/p> As an example, let us consider a situation where we already have adjusted OHLC quotes imported into the database and we have a file containing unadjusted quotes in the following format:<\/p> Ticker,Date,Aux1 In order to import those quotes into Aux1<\/strong> field and combine with existing data, go to File->Import Wizard<\/strong> menu, pick the file and define format the following way:<\/p> <\/p> First we need to define columns so they match the format of input data (in this case set first three columns to Ticker<\/strong>, DMY<\/strong>, Aux1<\/strong> and the rest to Skip<\/strong>).<\/p> To activate special hybrid mode we need to type:<\/p> $HYBRID 1<\/p> into Additional Commands<\/strong> box and since we are not importing regular prices that include Close array, we also need to mark Allow negative prices<\/strong>.<\/p> If instead of using the wizard we create import definition file manually, then it should contain:<\/p> $HYBRID 1 Now we can verify the results in Symbol->Quote Editor<\/strong>. The OHLC fields still contain adjusted values, while additional data has been properly stored in Aux1<\/strong> field without affecting the other fields.<\/p> <\/p> For more information about Import Wizard and ASCII importer please check the following parts of the User’s Guide: Sometimes it is useful to update existing database with quotes from other source and sometimes we just want to update one data field, leaving other unaffected. For example we may want to import data into Aux1 and Aux2 fields leaving regular OHLC prices untouched.This post will show how to use $HYBRID mode of ASCII importer […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[54],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/561"}],"collection":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/comments?post=561"}],"version-history":[{"count":2,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/561\/revisions"}],"predecessor-version":[{"id":571,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/561\/revisions\/571"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
AAPL,13-10-2014,99.81
AAPL,10-10-2014,100.73
AAPL,09-10-2014,101.02
AAPL,08-10-2014,100.80
AAPL,07-10-2014,98.75
AAPL,06-10-2014,99.62
AAPL,03-10-2014,99.62
AAPL,02-10-2014,99.90
AAPL,01-10-2014,99.18
AAPL,30-09-2014,100.75
AAPL,29-09-2014,100.11<\/p><\/blockquote>
$ALLOWNEG 1<\/p>
http:\/\/www.amibroker.com\/guide\/w_impwizard.html<\/a>
http:\/\/www.amibroker.com\/guide\/d_ascii.html<\/a><\/p>","protected":false},"excerpt":{"rendered":"