John,
try:
RECEIVE PACKET($DocRef;$TextValue;Char(13)) //return
or
RECEIVE PACKET($DocRef;$TextValue;Char(10)) // line feed
or
RECEIVE PACKET($DocRef;$TextValue;Char(13)+Char(10)) // both of the above
depending on how much control you have on the incoming file it could be any
combination
my preferred way is:
$EOL := Test_EOL($DocRef)
if ($EOL #"")
RECEIVE PACKET($DocRef;$TextValue;$EOL)
`do stuff
below written in email so...
Test_EOL
`$1 - time - document reference
`RETURNS - text - EOL character or empty string if none found
c_time($1;$DocRef)
c_text($TextValue;Return;$0)
c_boolean($EOF)
$DocRef := $1
Repeat
RECEIVE PACKET($DocRef;$TextValue;100)
case of
: (position(char(13)+char(10),$TextValue) >0)
$return := char(13)+char(10)
: (position(char(13),$TextValue) >0)
$return := char(13)
: (position(char(10),$TextValue) >0)
$return := char(10)
:(OK = 0)
$EOF:=true
end case
until ($return#"") | ($EOF)
`I forget the command - but reset read point in file to start
`end
> I have a tab delimited text file and I want to get the first row with…
>
> C_TEXT($TextValue)
> $DocRef:=Open document($IndexPath)
> RECEIVE PACKET($DocRef;$TextValue;”\r")
> CLOSE DOCUMENT($DocRef)
>
> This was working fine until about an hour ago when it suddenly
> started bringing in the whole document which has many rows. Using “\t
> ” works fine just bringing the first field in the first row.
> Any ideas?
>
> Mac OS High Sierra
> 4D v14 in Unicode mode
>
> John
>
>
> John Baughman
> Kailua, Hawaii
> (808) 262-0328
> [email protected]
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive: http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
------------
Hell is other people
Jean-Paul Sartre
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************