0

I am working on a project where I access data locally (via Dropbox). I am having trouble finding a method to take the numbers from the data file. I can take the entire data file, which is relatively small, but I want to sort through and just collect the decimal values, I don't care for the text. Finding the useful functions and how they work has been a challenge. Curious if anyone on here had any method to point me in the right direction. Looking for particular functions that can assist me. If not, thanks anyhow.

    getnumberstest2() updating;

    vars
file    :   File;
source  :   String;
line    :   String;
test2   :   String;
test3   :   Array;
cust    :   Customer;
i       :   Integer;
pizza   :   DecimalArray;
    begin
create file transient;
file.fileName   :=  "C:\Users\Chris\Dropbox\Capstone\ChrisQ\SAgent1.txt";
file.kind       :=  File.Kind_Unknown_Text;
file.mode       :=  File.Mode_Input;
file.open;
i               := 1;
beginTransaction;
    while not file.endOfFile do
        line    := file.readLine;
        test2   := line[1:end];
        create cust;
        cust.source := test2[i];
        write test2[i];
        write test2;
        test3   := test2[1];   //This is the incompatible types error
    endwhile;
commitTransaction;
    epilog
delete file;
    end;
  • show an example of the file and its content and structure, without it it's not possible to help you. But I think jade is not really suitable for your task, it's a template engine, not a parser – timaschew Mar 06 '14 at 15:54
  • You are right, i meant to tag it as JADE, the agent development environment....is there any relation? – user3386718 Mar 07 '14 at 04:20
  • I've edited the tag, but you should add an example of your file anyway – timaschew Mar 07 '14 at 08:48
  • The method I have been constructing is below, it is a bit messy/unorganized as I have been trying different techniques to see if anything would work. What it comes down to is that I am reading the data as a string, but the data is a combination of words and numbers (ints and decimal). My goal is I want to assign the number values to variables. you will see the 'write' function in my code, this is simply to display the the screen so I can see exactly what it going on.... – user3386718 Mar 07 '14 at 17:23
  • ....how do I add a file on here? I tried copy and paste, but its a few characters too long. – user3386718 Mar 07 '14 at 17:24
  • I figured out how to do it and if anyone else needs help with this task let me know. – user3386718 Mar 20 '14 at 18:42
  • just pots your answer as an answer, it's okay to do it! – timaschew Mar 21 '14 at 14:25

0 Answers0