Latest Uploads
image-15-0 ... -19-40.jpg

Jayenkai

image-15-0 ... -20-07.jpg

Jayenkai

Bumble Bee

dna

Tires

dna

Guess The Remake

rychan

Julia Set Visualer

Andy_A

Forum Home

File Manipulation

UserMessage
Posted : Monday, 06 December 2010, 03:34 | Permalink
mole


WW Entries : 7
Hi,

Long time no see. I still lurk occasionally but I haven't posted for a while and I certianly haven't coded for a while. Hence, I am rusty.

Therein lies my dilemna: I have a task I wish to complete, and I believe that a little Blitz program will make this easier.... If only I could properly remember how to program, that is.

Anyway, I'll start off with my first problem. I am trying to read a column of data from a text file. The first line of the column is a text string and the lines beneath are floats. I am trying to commit this data to 2 arrays: 'FirmName$(a)' for the string, and all of the rest of the floats into 'DataSet1#(b)'.

Here if my code so far. Unfortunately, I have got stuck quite early on in the sense that my debug reporting suggests that it can't see any data in the file...

-->

Any help, links, tips would be super cool.

I will no doubt return quickly after this problem is solved with another problem, as my program develops in size and sophistication.

Thanks in advance!

Homepage : www.squigglesoft.co.nr
Posted : Monday, 06 December 2010, 03:55 | Permalink | Mark Here
Jayenkai


WW Entries : 103
Is the "Float" stored AS a float, or is it a line of text?
(as in, if you open the .dat in notepad, is it readable, or gobbledegook)

If so, ReadTxt$=ReadLine(CorrelData): Read1#=float(ReadTxt$)

-----
"Load, Next List!"
Homepage : http://AGameAWeek.com
Posted : Monday, 06 December 2010, 08:11 | Permalink | Mark Here
mole


WW Entries : 7
The data in the file is readable. I will upload it for reference.

I managed get the program to output the data as I expect it to; the data is being stored as I want.

However, that means we now have the next step. By the end, the file will have anything up to 100 columns of data. I need to be able to store all that data in arrays (I can't quite remember but can you have arrays such as 'Dim ArrayName(5,5)'?).

When all the data is stored, I hope to be able to calculate the correlation coefficients between each of the columns of data. That is something I will consider more deeply when I get to it; at the moment I am just trying to get all the data into array ready for processing.

What I can't think of how to do, is the parse/read the file of data and get each chunk of data into its appropriate place in the array. that is where I need help. I never was good at file manipulation

Here is the latest code:
-->

Correlation Data File
Note that I had to change the file extension to the less cool .txt in order to upload it.
Homepage : www.squigglesoft.co.nr
Posted : Monday, 06 December 2010, 17:57 | Permalink | Mark Here
Andy_A


Here's what it sounds like you want.

-->
Posted : Wednesday, 08 December 2010, 06:19 | Permalink | Mark Here
mole


WW Entries : 7
I have spend the last day and a half working on your code, Andy, and fine tuning it/modifying it to my needs. Your structure has proved invaluable in allowing me to progress, so a big thanks for that.

The latest I have done so far is make it super easy to change the number of firms in the data file without making the program have a wobbly, introduce a correlation coefficient calculator function, and implement it in a manner such that it calculates the coefficients between all the firms in the data file.

Calculating the correlation coefficient between the data from the file is exactly what I wanted - and it works! This makes me happy.

So now that the program is robust enough for my needs, all I need to do now is get data on another 95 firms or so!!

I should be able to make any minor modifications to the program if the need arises, but I'll be back if there is something that stumps me

Many thanks for your help, Jay and Andy. It is most appreciated.
Homepage : www.squigglesoft.co.nr
Posted : Wednesday, 08 December 2010, 06:35 | Permalink | Mark Here
Jayenkai


WW Entries : 103
Sorry, I completely forget to get back to this topic! Glad you sorta sorted it!

-----
"Load, Next List!"
Homepage : http://AGameAWeek.com
Posted : Wednesday, 08 December 2010, 08:44 | Permalink | Mark Here
Andy_A


Glad it all worked out for you.

Getting the data into arrays was the toughest part (and it wasn't all that hard).
Latest Posts
AGameAWeek iOS Bundle
rychan Thu 08:46
Ex XBox
rychan Thu 07:54
Watch Out! Car!
steve_ancell Thu 06:34
''Unique''
spinal Wed 02:20
Legitimate Logo Services
spinal Tue 13:26
Coming soon, to a printer near you!
steve_ancell Tue 12:22
RIP : Douglas E Smith
steve_ancell Tue 12:16
Telly Picks
HoboBen Tue 09:38
Microbricks aka BingCraft aka XBlocks
spinal Tue 02:25
Preemptive Lock!
Jayenkai Mon 16:07
More

Latest Items
Blog : Bedroom 2.0
rychan Thu 14:06
Blog : 20 Years Ago....
steve_ancell Mon 15:28
Life : Back Online
Kuron Tue 11:48
Showcase : Munky Blocks DX
Jayenkai Mon 07:06
Showcase : Little Nemo's Nightmare
Jayenkai Sat 04:14
News : Newsletter #234
rychan Fri 08:02
Showcase : Space Rocket Adventurers
HoboBen Thu 16:56
Blog : Health Update : August 2014
Jayenkai Sat 11:31
Techy : Back from Game Dev Con!
Jayenkai Sun 16:52
Family : Sunday
Jayenkai Wed 03:31
Family : Good News (for once)
Kuron Tue 15:37
Showcase : Don't Tap The Zombies
therevillsgames Mon 16:26
Showcase : Mutant Monty
steve_ancell Wed 19:26
Techy : New Laptop!?
Kuron Fri 15:52
Showcase : Ascension 2 Live Wallpaper
CodersRule Fri 13:48
More

Who's Online
HoboBen
Thu, at 17:39
Jayenkai
Thu, at 17:38
rychan
Thu, at 16:14
spinal
Thu, at 15:36
steve_ancell
Thu, at 15:36
dna
Thu, at 12:51
Kuron
Thu, at 12:19
shroom_monk
Thu, at 09:48
brdtt12
Thu, at 09:08
rockford
Thu, at 05:38
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.