|
Pages: [1]
|
 |
|
Author
|
Topic: text too graph (Read 380 times)
|
|
estteban
|
helllo,
I need some help, i want to pick specific text (numbers) from a text file, create a graph (in a web page or excel), than delete the text file and continue getting the specific text from a new text file, and this process will continue on and on.
Thanks,
Estteban
|
|
|
|
|
Logged
|
|
|
|
|
notchent
|
Hi Estteban, That question is a bit too vague to answer. If you provide an example text file, decide what sort of graph you want to create, possibly provide some sort of example code that you're starting with, and explain the other necessary specifics, you'll be more likely to get some guidance What you described so far might look something like this in code: rebol []
estteban-func: does [ data: load %filename.txt ; where %filname.txt contains a block of Rebol values graph data ; where "graph" is a function that needs to be created to do the graphing delete %filename.txt ; somehow this new file needs to be created. How does this happen? ]
while [1 = 1] [ estteban-func ; if (some condition) [break] ]
|
|
|
|
|
Logged
|
|
|
|
|
estteban
|
Hi Notchent,
Thanks for replying, there will always be 2 files in the C:\cw directory, (cw1.txt and cw2.txt, the textfile will look like this:
2 1.03 2 1.04 3 1.25 2 1.06 1 1.00 3 1.29 2 1.05 X 1.22 1 1.01
Every line in column 1 starts with either 1,2,3 0r X, I want to call 1(low), 2(good), 3(High), and X (extended). That is the only thing I am interested in, export all the 1,2 ,3 , and X to a web page that includes like a statistical Graphical bar that displays how many 1,2,3,or X have accumulated at any specific time. After I am able to do this I want to delete cw1.txt file and start reading cw2.txt (same process), than I want to delete cw2.txt and start reading the data from cw1.txt file.
I hope this helps, Thanks for your help, Estteban
|
|
|
|
|
Logged
|
|
|
|
|
btiffin
|
Estteban; There are a few ways of generating plots. To stay within the REBOL toolkits; snag http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=q-plot.rand http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=ez-plot.rMatt did a beautiful job of providing a REBOL dialect for charts and graphs, ez-plot is the demo for the q-plot dialect. These will produce REBOL view faces. Converting a face to a graphic is as easy as to image! face, then save/png. Then you could write a little HTML that links to the image >> do %q-plot.r >> img: to image! quick-plot [200x200 bars [1 2 3 4 5 4 3 3 2 1]] >> save/png %mygraph.png img >> write %showgraph.html {<html><body><img src="file:///home/brian/.rebol/view/plot/mygraph.png"></body></html>}
Something like that perhaps. Check the ez-plot for good coverage of q-plot. I used a simple bar graph, and you'd plop in the data you summed for each key where I used [1 2 3 4 ...] And, listen to more of Nick's advice. I think he may becoming the king of getting REBOL graphics on websites and in videos.  Cheers
|
|
|
|
|
Logged
|
|
|
|
|
estteban
|
Hi btiffin, Thanks for the Links, I can quite seem to get the x-axis to display only 4 bars, my last 4 lines of the code is:
bars [500 300 800 200 1000 300 400 900 500 700] label "TEST BARS" y-axis 9 x-axis 4 ]
But it lways displays 9 Bars, no matter what I change in x-axis
Regards, Estteban
|
|
|
|
|
Logged
|
|
|
|
|
btiffin
|
I'm pretty sure the x-axis dialect command is for labeling.
You'll have to restrict the entries in the Bars block if you only want 4, afaik.
Or use points and then play with scale? q-plot has a lot in it, and I'll not pretend to have any expertise. I figure out enough to make the graph at hand and then stop looking.
Cheers, Brian
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2314 Posts in 596 Topics by 4201 Members
Latest Member: preertFuesque
|