debluzz
Junior Member
Thanks tsh73 I'll work with it.
Posts: 57
|
Post by debluzz on Feb 23, 2020 10:02:29 GMT -5
why can't I use : #w.tb, with inputcsv ?
inputcsv #fIn, myArray$( i, j)
print #w.tb, inputcsv #fIn, myArray$( i, j)
|
|
|
Post by Brandon Parker on Feb 23, 2020 21:14:46 GMT -5
Liberty BASIC will not print to a TextBox and InputCSV as a single command. At least that is what I think your last line is attempting to do.
Input the CSV data into the array first and then print to the TextBox after the data is in the array.
{:0)
Brandon Parker
|
|
|
Post by Rod on Feb 24, 2020 4:26:32 GMT -5
If it is a small amount of csv data and a fixed size you can get it into an array like this.
open "somefile.txt" for output as #1 print #1, "1,2,3,4,5,6,7,8,9"
close #1
open "someFile.txt" for input as #fIn inputcsv #fIn, i$(1),i$(2),i$(3),i$(4),i$(5),i$(6),i$(7),i$(8),i$(9) for n= 1 to 9 print i$(n);" "; next close #fIn end
However for large data sets you are better off using one of the other input commands and parsing the data to an array. You have more flexibility if the data set varies.
|
|
debluzz
Junior Member
Thanks tsh73 I'll work with it.
Posts: 57
|
Post by debluzz on Feb 25, 2020 9:38:57 GMT -5
NEW QUESTION:
1)this is how I need page to look and fit on page.<code> ORDER OF ENTRY # CLS TIME ES LS STRFN SCORE TOTAL
#1 12 2957 19 0 16 12 25 #2 14 3076 10 0 13 37 17 #3 11 3009 07 1 24 11 13 #4 13 2965 07 3 24 13 13 #5 11 2995 11 1 20 11 16 #6 13 2994 08 1 18 12 15 #7 13 2952 12 1 14 27 25 #8 12 3020 05 3 16 11 10
HIGH-CLASS #2 14 3076 10 0 13 37 17 #4 13 2965 07 3 24 13 13
LOW-CLASS #5 11 2995 11 1 20 11 16 #3 11 3009 07 1 24 11 13 #1 12 2957 19 0 16 12 25 TOP TIME #7 13 2952 12 1 14 27 25 #1 12 2957 19 0 16 12 25 #4 13 2965 07 3 24 13 13
EARLY #1 12 2957 19 0 16 12 25 #7 13 2952 12 1 14 27 25 #5 11 2995 11 1 20 11 16
LATE #8 12 3020 05 3 16 11 10 #4 13 2965 07 3 24 13 13 #6 13 2994 08 1 18 12 15</>
program: This is the program used to produce the above
<code> dim myArray4( 8, 8) ' you know it's 5 columns but not how many rows..
open "wid2.txt" for input as #fIn
for i =1 to 8 for j =1 to 8 inputcsv #fIn, myArray$( i, j) next j if eof( #fIn) then exit for next i
close #fIn
rowCount =i print " ORDER OF ENTRY " print "# CLS TIME ES LS STRFN SCORE TOTAL" print " " for i =1 to rowCount for j =1 to 8 print myArray$( i, j), next j print "" next i print "__________________________________________________________________________________"
print " HIGH-CLASS "
sort myArray$(), rowCount, 1, 2 ' rowCount 4 to 1 sorted on column 2
for i =1 to rowCount -7 for j =1 to 8 print myArray$( i, j), next j print "" next i ' print "Yeah!!"
'end
print " " print " LOW-CLASS "
sort myArray$(),1, rowCount, 2' rowCount 4 to 1 sorted on column 2
for i = 0 to rowCount-5 for j=1 to 8 print myArray$( i, j), next j print "" next i
print " TOP TIME"
sort myArray$(), 1, rowCount, 3 ' rowCount 1 to rowCount sorted on column 3
for i =0 to rowCount-5 for j =1 to 8 print myArray$( i, j), next j print "" next i print "" print " TOP EARLY "
sort myArray$(), rowCount,1, 4 ' rowCount 1 to rowCount sorted on column 4
for i =1 to rowCount-6 for j =1 to 8 print myArray$( i, j), next j print "" next i print "" print " TOP LATE"
sort myArray$(), rowCount, 1, 5 ' rowCount 4 to 1 sorted on column 5
for i =1 to rowCount-6 for j =1 to 8 print myArray$( i, j), next j print "" next i
'print "Yeah!!"
'run "write "+chr$(34)+"test.txt" end</>
this is the data used for this run: " #1 ",12,2957,19,0,16,12,25 " #2 ",14,3076,10,0,13,37,17 " #3 ",11,3009,07,1,24,11,13 " #4 ",13,2965,07,3,24,13,13 " #5 ",11,2995,11,1,20,11,16 " #6 ",13,2994,08,1,18,12,15 " #7 ",13,2952,12,1,14,27,25 " #8 ",12,3020,05,3,16,11,10
also.....how do I make this data in the format that it is in.(CVS)? I manually enter this data into this format.
I need to run the program: (1)make data file (automatic) (2)format printout to fit and alighn on 1-page (automatic)
everything i'm doing is manual(lack of knowing)
They say cvs is easy.....to me its not so easy...
help is needed...lost in files land
|
|
|
Post by Rod on Feb 25, 2020 12:03:42 GMT -5
Well the data you list is already in Comma Separated Value CSV format. So just write it to a file. Or is it in a file already?
open "test.csv" for output as #1 #1 "#1,12,2957,19,0,16,12,25" #1 "#2,14,3076,10,0,13,37,17" #1 "#3,11,3009,07,1,24,11,13" #1 "#4,13,2965,07,3,24,13,13" #1 "#5,11,2995,11,1,20,11,16" #1 "#6,13,2994,08,1,18,12,15" #1 "#7,13,2952,12,1,14,27,25" #1 "#8,12,3020,05,3,16,11,10" close #1
|
|
debluzz
Junior Member
Thanks tsh73 I'll work with it.
Posts: 57
|
Post by debluzz on Feb 25, 2020 23:23:58 GMT -5
Thanks Rod,
The data I enter in by hand to the file you see.
I can't figure out how to get my program do this for me.
|
|
|
Post by Rod on Feb 26, 2020 2:34:48 GMT -5
Not sure I understand the problem. Do you mean you want a program that takes your keyed input and outputs a file like I show in my last answer.? I thought you see parsing web data to get the file?
|
|
debluzz
Junior Member
Thanks tsh73 I'll work with it.
Posts: 57
|
Post by debluzz on Feb 26, 2020 7:48:02 GMT -5
when the program runs. and says (run complete). all is good...but when I print-out it does not fit on 1-page. I have to delete spacing in between the fields. That is one problem.
The second problem is, when I run my main program. I need a cvs for my data to go to. I use (#w.tb$,) to save data to files.
Hope this makes more sence
|
|
debluzz
Junior Member
Thanks tsh73 I'll work with it.
Posts: 57
|
Post by debluzz on Feb 26, 2020 7:55:30 GMT -5
Rod, this is where the data comes from. This is another program not the one above. this is just the variables.
PRINT #w.tb," CLASS CLS% TIME ES LS STRFN PAIRS TOTAL"
PRINT #w.tb,"#";DOG$;" ";int(CLASS);" ";CLASSPER$;" ";INT(TIME);" ";int(EARLYSPEED);" ";int(LATESPEED);";" ";STRFN2;"
|
|