function process_mscovert(outputpath_amibriker, filename)
{
var fs=require('fs');
if(!fs.existsSync(outputpath_amibriker+'msd'))
{
fs.mkdir(outputpath_amibriker+'msd', 0777, function(err){
if(err)console.log('error'+err);
});
}
if(filename.search("Nse_Cash_Market_cm")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nsecm \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("BSE_Cash_Market_EQ")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'bsecmeq \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("MCX_Com_mcxbhavcopy")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'mcxbhavcopy \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("MCX_Indices_MCXIndex")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'mcxindex \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("MCX_Indices_MCXSpotIndex")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'mcxspotindex \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NCDEX_Market_NCDEXfno")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'ncdex \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NSE_ETF_etf")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nseetf \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NSE_Forex_Futures_cf")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nseff \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NSE_Forex_Options_co")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nsefo \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NSE_Equity_Futures_fo")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nsef \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NSE_Equity_Options_op")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nseo \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NSE_Indices_nseindex")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nseindex \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("BSE_Indices_bseindex")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'bseindex \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("National_Spot_nesl")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nesl \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("NSE_SME_sme")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'nsesme \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("eod")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'eod \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("Yahoo_Fundamental")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'yahoodata \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("yahoo_eod")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'yahooeod \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("yahoort")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'yahoort \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("yahooieod_5min")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'yahooieod5m \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("yahooieod_1min")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'yahooieod1m \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("googleeod")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'googleeod \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("googleieod_1min")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'googleieod1m \n','UTF-8',function (err)
{
console.log(err);
});
}
if(filename.search("googleieod_5min")>=0)
{
fs.appendFileSync("mscovert.bat",'asc2ms -f '+outputpath_amibriker+filename+' -r r -o '+outputpath_amibriker+'msd/'+'googleieod5m \n','UTF-8',function (err)
{
console.log(err);
});
}
}
function msconvert(outputpath,m, baseurl)
{
document.getElementById("om").innerHTML+='<br>MS Covert processing is started...';
Ext.getCmp('pbar3').updateText('MS Converting started...');
var spawn = require('child_process').spawn,
ls = spawn('mscovert.bat', ['','']);
ls.stdout.on('data', function (data) {
document.getElementById("om").innerHTML+='<br><font color=green>stdout: </font>' + data;
loadprogressbar();
Ext.getCmp('pbar3').updateText('MS Converting...');
});
ls.on('exit', function (code) {
Ext.getCmp('pbar3').updateText('MS Converting completed...');
if(code==0)document.getElementById("om").innerHTML+='<br><font color=green>Successfully completed.</font>';
else document.getElementById("om").innerHTML+='<br><font color=red>Execution Fail.</font>';
var fs=require('fs');
if(fs.existsSync('mscovert.bat'))
fs.unlink('mscovert.bat', function(err){
if(err)console.log('Error'+err);
});
m++;
processfun(outputpath,m, baseurl);
});
}