Jump to content
Sign in to follow this  
McPete

Text Converter

Recommended Posts

McPete

Hey, i know this is probably a simple question but i just cant figurr out how to do it. :-( Well i have a text file in which values wich belong to a chart are listed like this:

"year.month.day , hour:minute , high , low"

so now i want to convert every line to:

"date=year-month-day time=hour:minute high=high low=low"

i would be very thankful if you could help me.

Share this post


Link to post
Share on other sites
oMBRa

can you post an example of the contents of the text file?

Share this post


Link to post
Share on other sites
Inverted

If they are comma seperated like your one-line example, then it should be simple.

Share this post


Link to post
Share on other sites
McPete

yea sure:

CODE
2008.07.17,18:05,1.5883,1.5884,1.5878,1.5879,58

2008.07.17,18:10,1.5878,1.5884,1.5875,1.5876,76

2008.07.17,18:15,1.5877,1.5879,1.5873,1.5873,61

2008.07.17,18:20,1.5874,1.5887,1.5874,1.5877,60

2008.07.17,18:25,1.5878,1.5879,1.5864,1.5870,120

2008.07.17,18:30,1.5871,1.5877,1.5869,1.5873,74

2008.07.17,18:35,1.5874,1.5874,1.5863,1.5865,67

2008.07.17,18:40,1.5867,1.5867,1.5856,1.5862,96

2008.07.17,18:45,1.5863,1.5864,1.5858,1.5863,62

to

CODE
<Candle endtime="2009-04-06 03:45:00.0" starttime="2009-04-06 03:40:00.0" openbid="1.5283" highbid="1.5288" lowbid="1.5281" closebid="1.5286" openask="1.5289" highask="1.5291" lowask="1.5286" closeask="1.529" vol="118"/>

<Candle endtime="2009-04-06 03:50:00.0" starttime="2009-04-06 03:45:00.0" openbid="1.5286" highbid="1.5289" lowbid="1.5281" closebid="1.5285" openask="1.5289" highask="1.5293" lowask="1.5286" closeask="1.5288" vol="132"/>

<Candle endtime="2009-04-06 03:55:00.0" starttime="2009-04-06 03:50:00.0" openbid="1.5284" highbid="1.5285" lowbid="1.5275" closebid="1.5275" openask="1.5288" highask="1.5288" lowask="1.5279" closeask="1.5282" vol="180"/>

where "Candle endtime=" is supposed to be the date given inthe first list "starttime=" the date given minus 5 minutes, "openbid" "highbid" "lowbid" "closebid" are the values after the "time" in the first list ( in that order) and "openask" "highask" "lowask" "closeask" are the values fromt first list plus 0.0007

Share this post


Link to post
Share on other sites
oMBRa

it's totally different from what you asked in the first post...

so the output should be like your first or second post?

Share this post


Link to post
Share on other sites
McPete

:-D sorry for that. i just wanted to make the problem as simple as possible. well the output should be as said in the second post.

Share this post


Link to post
Share on other sites
Valuater

it's totally different from what you asked in the first post...

so the output should be like your first or second post?

I agree... Nowhere near what you asked for!!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
McPete

hmm well i think i should change my way of explaining things. :D

Still could you please help me do that?

Share this post


Link to post
Share on other sites
Inverted

This is for an automatic bidder, right ? I hate those :D

Share this post


Link to post
Share on other sites
McPete

Nope its not. I just have history data from one program and i want to be able to analyse them in a different program which just needs the data to be like that. And if you are now wondering why i would want to do that: I just like the other program a lot better and i am a lot more used to it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.