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

Re: [amibroker] Substuting ";" with "," in a TWS trade file



PureBytes Links

Trading Reference Links

Herman,
    How do you want to do it?

I have a JScript file that does just what you are after.

Or (Prefered method) do as Ara said. Use StrFind etc
to locate each sub section.

eg (not real code)
Line = Readline from file....
for I = 1 to StrLen(Line)
 Loc = StrFind(Line); //Find 1st occurance left to right
 Part(I) = StrLeft(Line,Loc); //Allocate x part.
 RightNum = StrLen(Line) - Loc; //Calc remaining  str len.
 Line = StrRight(RightNum);
Next I;

Or something like that  (Have to check the RightNum assignment - I think 
it's not quite right*)
Anyway gota go - Just popped home for 5min and out again. ;-)

*Umm yeah - The for loop will continue after the string has been 
dismembered. You'd have to fix that.

Atb
    Michael.

Herman van den Bergen wrote:

> would anyone have code or know how to substitute semi-colons in a file 
> with commas?
>  
> The TWS outputs trade records in semi-colon separated text file, like so:
>  
> RIMM;SLD;50;72.56;13:32:59;20050407;ISLAND;U84507;;;534;
> RIMM;BOT;100;73.04;13:37:49;20050407;ISLAND;U84507;;;534;
> RIMM;SLD;50;73.44;13:41:56;20050407;ISLAND;U84507;;;534;
> RIMM;SLD;50;73.44;13:41:56;20050407;ISLAND;U84507;;;534;
>  
> I want to read the files with afl which would be so much easier if the 
> semi-colons were commas.
>  
> many thanks for any help you can give!
>  
> herman
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.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
>       <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/>.
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/