2011-02-25 10:39 PM
...its contents are interpreted by the extension.There is a clear functional connection between OPEN and INPUT. Can there be be other declarations between the OPEN and INPUT statements? Often such code seems to fail (for me). Can I assume that
2011-02-25 11:07 PM
2011-02-26 05:53 AM
2011-02-26 06:08 AM
Karl wrote:Someone in our office had it working just fine using "TXT" -- in line with the interpretation that 'they must mean file extension.' I was not able to get that to happen and was really surprised when he showed me. I was not able to get SEPARATOR = ',' to function properly, but had no trouble with SEPARATOR = '|'. Would you happen to know (before I get to try it) if white space (not only '\t')can serve as a separator?
... There, you see that the OPEN command takes as its first argument a 'filter', which must be the quoted string "TEXT" to access the text i/O add-on. (The syntax should just SHOW "TEXT" there, since it is giving the syntax for the add-on, of course.)
2011-03-01 08:52 AM
open("text", "SHS Cold-Formed(13).txt", "separator='\t', mode=ro, Library")I'm aware that there is a gap between the abstract and succint documentation GDL Manual offers and between the available books about GDL. We intend to fill this gap with the Basic Library Documentation, but it's an ongoing task which won't be finished soon. I can't think about a way to speed this process up:(
2011-03-01 04:36 PM
2016-05-19 10:51 AM
0008, 1234, 5678The first value is for example: 0008 and I read my csv source file like this:
channel = OPEN ("TEXT", filename, "SEPARATOR = ',', MODE=RO, LIBRARY") n = INPUT (channel, i, 1, number)The result of number will be a interpreted by INPUT as a number not a string. To be able to use it as a string of length n (in my case 4) with leading zero's I came up with the following.
! add 10000 (10 to the power of n+1) for allowing leading zeros number = 10000 + number ! number = 10008 ! use STR to convert the whole number to a string string = STR(number, 5, 0) ! number = '10008' ! use STRSUB to read only the last 4 characters (2 to 5) of string string = STRSUB(string, 2, 5) ! number = '0008'I hope this will help some people solving similar issues
2016-05-19 06:45 PM
2016-05-20 03:38 AM
Aaron wrote:And THANK YOU, Wilt. I don't know what else to say, after 5 years.
what dogged perseverance. Well done! Thanks.