Hi Pucker,
to avoid too much typing you could also use the "url" systax!
1. Read a text file and put it into a field:
(Hint: Rev always uses the UNIX path delimiter SLASH internally!)
...
put url("file:C:/Users/Andrew/Desktop/demo.txt") into field "Name of your field here"
...
2. You can also specify CHUNKS of text to be read:
...
## Only first three character
put CHAR 1 to 3 of url("file:C:/Users/Andrew/Desktop/demo.txt") into field "Name of your field here"
...
## Only line 1, 2 and 3
put line 1 to 3 of url("file:C:/Users/Andrew/Desktop/demo.txt") into field "Name of your field here"
...
## Last line of file
put line - 1 url("file:C:/Users/Andrew/Desktop/demo.txt") into field "Name of your field here"
...
3. To read non contiguous lines you need to read the whole file and then extract the lines (or characters) you need
## Read complete file into a variable
put url("file:C:/Users/Andrew/Desktop/demo.txt") into tVariable
put line 1 of tVariable & CR & line 4 of tVariable & CR & line 88 of tVariable into field "Name of your field here"
...
To wite content to a file do this the other way round
1. Write content of variable to file
...
put tVariable into url("file:C:/Users/Andrew/Desktop/demo.txt")
...
2. Content of a field
...
put field "Your field" of cd 1 of stack "whatever stack the field is in" into url("file:C:/Users/Andrew/Desktop/demo.txt")
...
3. Non contiguous lines of variable oor field
put line 1 of tVariable & CR & line 4 of tVariable & CR & line 88 into url("file:C:/Users/Andrew/Desktop/demo.txt")
...
Hope that helps!
Best from germany
Klaus