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

*your article*



PureBytes Links

Trading Reference Links

I would like to thank you very much for your help, I really appreciate
that,
this saves a lot of typing time, some serious about market know that.
Hopefully Unix platform will be more popular for Equis users in the future.
This is very nice code, but On my PC I could not chop and split.
PC Cobol will do the job as well.

Pi=3.14 
----------
 

> #!/usr/local/bin/perl
> # usage: perl parse.pl inputFile outputFile dataType date
> # guess what? Hash(#)=comments, shebang (#!) is special
> ($InputFile,$OutputFile,$DataType,$thisDate)=@xxxx;  
> open (INFILE, "$InputFile") || die ("Input File not found");   
> open (OUTFILE, ">$OutputFile") || die("Can't open output file"); 
> until (eof(INFILE)) {
>         $thisQuote = <INFILE>;  # read a line
>         chop ($thisQuote);  # remove end of line char       
>         ($t,$o,$h,$l,$c,$vol)=split(/[\s]+/,$thisQuote);  # [1]
> 	if (length($t)>0) {    # check for bad line [2]
> 		print OUTFILE ("$t,$o,$h,$l,$c,$vol\n");         
> 	}
> }                                                              
> close INFILE;                                                    
> close OUTFILE;
>