Page 1 of 1
newbie question on fields
Posted: Mon Apr 16, 2007 1:24 pm
by churchken
Hi,
The following script correctly "puts" a text file into a variable. The accurate number of characters is placed into the card variable "filesize".
put URL ("file:" & it) into tFileData
put the number of characters in tFileData into tFileChars
put tFileChars into field "filesize"
put tFileData into field "DataText"
However, the "field" "DataText" on a card only receives a portion of the text data, not the total number of characters. Is there a reason for the text to be limited in size? Is there a way to set the size of the text field?
Thanks -- and be prepared for more questions from this newbie !
Posted: Mon Apr 16, 2007 3:56 pm
by Mark
Hi Ken,
What kind of file are you trying to import? If it is a plain text file, this should just work. If not, could you please tell a little more about it?
Best,
Mark
file type
Posted: Mon Apr 16, 2007 4:31 pm
by churchken
Mark,
The file being imported is a plain text file -- however, it contains some html code characters. Here is a portion of the file:
<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 153<br>04/13/2007 ZN 07Jun 107085 12:35:33 PM 14<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 1<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 2<br>04/13/2007 ZN 07Jun 107085 12:35:34 PM 305<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 182<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 100<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM 5<br>04/13/2007 ZN 07Jun 107085 12:35:35 PM
If you would like to see the entire file, I would gladly email it to you.
Thanks so much for your assistance.
Posted: Mon Apr 16, 2007 4:36 pm
by Mark
Hi Ken,
I have no idea why Rev would cut off the data when displaying it in a field. Feel free to send your stack and the text file to m . schonewille (at) economy-x-talk . com . I'll have a look.
Best,
Mark
data file
Posted: Mon Apr 16, 2007 5:17 pm
by churchken
Mark,
Thanks so much -- stack & data file to import have been emailed to you.
Please let me know if you can duplicate this problem.
Best regards,
Posted: Mon Apr 16, 2007 10:42 pm
by Mark
Hi Ken,
Thanks for the stack and the data. Your file is a very messy HTML file, with lots of spaces in the beginning, some javascript and more garbage in the first 5456 (!) lines of the file. I just can't believe that people design web sites like this.
The actual data start with a header that looks as follows:
Date Com Mth Price Time Type Volume
---------- ----- -------- ------ --------- ------------ -----------
Unfortunately, the data following this header doesn't contain any linefeeds. As a result, the data consist of one line with a length equal to 65533 or more. Revolution cannot display lines that long and therefore the data is cut off at that line when displayed in a field.
You can solve this by including the line
Code: Select all
replace "<br>" with "<br>" & cr in tFileData
in your script, right after the line that reads the data from the file. This will break up the data into smaller lines that can be displayed in a field.
Best regards,
Mark
like a charm !
Posted: Mon Apr 16, 2007 10:54 pm
by churchken
Mark,
That worked perfectly to bring the whole file into the text field.
Thanks a bunch.
Best regards,