[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] AmiBroker 4.52.0 BETA released



PureBytes Links

Trading Reference Links

Using JScript,
Im not sure if this will be of help or hinderence.

I had need to extract 1 tickers data from a bunch of EOD files......
So I made a crude (And I do mean Crude) JScript file to do this.

Pehaps there is code in there that is usefull.
Here is the readme then the code.
  Im not attaching to email - As many people auto discard executable 
attachments.






Crude EOD.csv issue extracter:

Issue Finder will Search through a group of .csv files, And extract
a designated ticker/data.

Designed to extract a ticker from Multiple EOD.csv files.

The last characters are added to the end of filename and
counted 1 to 34. As per 1 month of EOD tickers.






/*
** AmiBroker/Win32 script.
**
** File:
** Updated:     January 18th, 2004
** Purpose:
** Language:    JavaScript (Windows Scripting Host)
**
** The data is stored in lines with following format
**
**
*/

/* change this line according to your data file name */
base = "am200401/am200401";
STicker = "GOLD";
/* Output file is STicker.csv */


WScript.Echo( "Ticker Find Started" );

var fso, fw, f, r;
var FName, outfile;
var ForReading = 1;
var ForWriting = 2;
var ForAppending = 8;

/* Create file system object */
fso = new ActiveXObject( "Scripting.FileSystemObject" );

outfile = STicker + ".csv";
fw = fso.OpenTextFile( outfile, ForAppending, false);

for( L1 = 1; L1 < 34; L1++ )
{
basename = base;
if (L1 < 10)
         {
          basename = basename + "0";
         }
FName = basename + (L1)+".prn";
ImportStocks(FName);
}
fw.Close();

WScript.Echo( "Ticker Find Finished" );


function ImportStocks( filename )
{
         var fields;
         var ticker;

         try
         {

         /* open ASCII file */
         f = fso.OpenTextFile( filename, ForReading);

         /* read the file line by line */
         while ( !f.AtEndOfStream )
                 {
                 r = f.ReadLine();

                 /* split the lines using comma as a separator */
                 fields = r.split(",");

                 ticker = fields[0];
                 if (ticker == STicker)
                         {
                          fw.WriteLine( r );
                         }
                 }
         }
         catch ( e )
         {

  WScript.echo( "There is a problem in file no." + L1 + ".\n"+ filename + 
"\nIt will be skipped and next file will be processed as normal" );

         }
}



























At 01:04 PM 15/03/2004, you wrote:
>Friends,
>
>Well ... here is a PERL script which will split Excel file saved as .CSV 
>file into
>individual .CSV files one per ticker.  One needs to have ActiveState 
>(freeware) PERL
>to run the script I've written.  No no ... this isn't JScript or VB Script 
>that will
>do the job end to end ... I am not (yet) familier enough with either to 
>code in
>that. But eventually I'll get there. *smile*
>
>I'm attaching screen-shot which shows how the program ran, what the input 
>was and
>what output was produced.  I'm also attaching 'abc.csv' and of course 
>'CSVsplit.pl'
>alongwith.
>
>Regards,
>- Salil V Gangal
>
>
>
>--- Salil V Gangal <salil_gangal@xxxxxxxxx> wrote:
> > mickeyamelinckx,
> >
> > Right !  Post by "d" does sound like 'Flame'.
> >
> > I was inquiring if someone has code to share for automating making
> > CSVs out of Excel, so that they can be imported into AmiBroker.  It
> > was amusing to suddenly see D's comment (I'd be more inclined to help
> > you if you were to return some of the kindnesses shown you).
> >
> > Anyways ... most likely I'll get at how to automate making of CSVs,
> > with out without any inclination from "d".
> >
> > Regards,
> > - Salil V Gangal
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "mickeyamelinckx" <mickeyA@xxxx>
> > wrote:
> > > "Friend",
> > > gee it really amazes me that some people´s mentality can be shown
> > so
> > > clear even on boards. And it comes clear in what state of mind SOME
> > > people are thinking on the net. I thought especially this group
> > with
> > > great people like Herman and many others had a far higher level of
> > > education and age then this post.  Sorry but this blows me away and
> > > had to say something about it and hope I´m not starting a comotion
> > on
> > > this one, so I will not react to any possible comments on this.
> > >
> > > Sorry this is not personal because you are probably not to blame
> > > personally !
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> > > > "Friend",
> > > >
> > > > I suggest you buy "Excel For Dummies". It has a lot of good
> > > examples of what
> > > > you're trying to do vis-a-vis the spreasheet.
> > > >
> > > > Why not post some of the stuff you've written for commentary
> > > automation? I
> > > > for one would like to see it. I'd be more inclined to help you if
> > > you were
> > > > to return some of the kindnesses shown you.
> > > >
> > > > d
> > > >
> > > >
> > > >   _____
> > > >
> > > > From: Salil V Gangal [mailto:salil_gangal@x...]
> > > > Sent: Sunday, March 14, 2004 11:31 AM
> > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > Subject: [amibroker] Excel Spread-sheet to AmiBroker ... Code ?
> > > >
> > > >
> > > > Friends,
> > > >
> > > > Hmmm ... anyone has any code to post for this sort of
> > automation ?
> > > >
> > > > Say I have Dates running across (Column B, C, D, E , F ... ) and
> > I
> > > > have Tickers running down (Row 1, 2, 3, 4, 5 ...) At the cross of
> > > Col-
> > > > n-Row I have 'price' value for the ticker.  Any code to automate
> > > the
> > > > extracting of data from such a spread-sheet and making .CSVs out
> > of
> > > > them ?
> > > >
> > > > A 'data plug-in' that allows one to define the rage from Excel SS
> > > to
> > > > be used as data range for importing 'live' into AmiBroker will be
> > > > nice to have ...
> > > >
> > > > Regards,
> > > > - Salil V Gangal
> > > >
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "Salil V Gangal"
> > > > <salil_gangal@xxxx> wrote:
> > > > > Graham,
> > > > >
> > > > > Nice to know. So as I wrote below >>>and is willing to post the
> > > > code ?
> > > > > <<< ... So will pls post the code ?
> > > > >
> > > > > Regards,
> > > > > - Salil V Gangal
> > > > >
> > > > >
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx>
> > wrote:
> > > > > > Yes I did a few weeks ago, or so. You can use the fget etc
> > > > functions
> > > > > >
> > > > > > Cheers,
> > > > > > Graham
> > > > > > http://e-wire.net.au/~eb_kavan/
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Salil V Gangal [mailto:salil_gangal@x...]
> > > > > > Sent: Sunday, March 14, 2004 10:34 AM
> > > > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > > > Subject: [amibroker] Excel Spread-sheet to AmiBroker
> > Automation
> > > > > >
> > > > > > Friends,
> > > > > >
> > > > > > Has anyone done any automation where the data from Excel
> > Spread-
> > > > > sheet
> > > > > > is imported into AmiBroker and is willing to post the code ?
> > > > > >
> > > > > > The approach is to save Excel data in CSV format and then
> > > import
> > > > > into
> > > > > > AmiBroker ... I'm looking for some examples of Automation
> > which
> > > > > > extract data from different columns and make CSV files.
> > > > > >
> > > > > > ... The best approach will be to have some sort of a live-
> > link
> > > > > > between Excel-source and AmiBroker-target, similar to what
> > one
> > > > can
> > > > > do
> > > > > > using Excel and Word.  The idea is that chart/data in
> > AmiBroker
> > > > > will
> > > > > > keep changing as and when data in Excel changes. (But I'll be
> > > > glad
> > > > > to
> > > > > > settle for just the Automation.)
> > > > > >
> > > > > > Regards,
> > > > > > - Salil V Gangal
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Send BUG REPORTS to bugs@xxxx
> > > > > > Send SUGGESTIONS to suggest@xxxx
> > > > > > -----------------------------------------
> > > > > > Post AmiQuote-related messages ONLY to:
> > > amiquote@xxxxxxxxxxxxxxx
> > > > > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > > > > --------------------------------------------
> > > > > > Check group FAQ at:
> > > > > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > > > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > > Send BUG REPORTS to bugs@xxxx
> > > > Send SUGGESTIONS to suggest@xxxx
> > > > -----------------------------------------
> > > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > > --------------------------------------------
> > > > Check group FAQ at:
> > > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > > >
> > > >
> > > >
> > > > Yahoo! Groups Sponsor
> > > >
> > > > ADVERTISEMENT
> > > >
> > > >
> > > >
> > > >
> > >
> > 
> <http://rd.yahoo.com/SIG=12cgrul3p/M=276465.4309739.5546025.1261774/D=> > 
> egroup
> > > >
> > >
> > web/S=1705632198:HM/EXP=1079368240/A=1854145/R=2/id=noscript/SIG=11r3i
> > > km62/*
> > > > http://autos.yahoo.com?refsrc=onnetwork/ads/Q4/lrec/stock>
> > > >
> > > > <http://us.adserver.yahoo.com/l?> > 
> M=276465.4309739.5546025.1261774/D=egroupweb
> > > > /S=:HM/A=1854145/rand=652834037>
> > > >
> > > >
> > > >   _____
> > > >
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > > * To visit your group on the web, go to:
> > > > http://groups.yahoo.com/group/amibroker/
> > > >
> > > >
> > > > * To unsubscribe from this group, send an email to:
> > > > amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > > > <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?> subject=Unsubscribe>
> > > >
> > > >
> > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > > Service
> > > > <http://docs.yahoo.com/info/terms/> .
> >
> >
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail - More reliable, more storage, less spam
>http://mail.yahoo.com
>
>
>Send BUG REPORTS to bugs@xxxxxxxxxxxxx
>Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
>-----------------------------------------
>Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>(Web page: http://groups.yahoo.com/group/amiquote/messages/)
>--------------------------------------------
>Check group FAQ at: 
>http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>Yahoo! Groups Links
>
>
>
>
>
>




Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/