Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: DEREK DODOO
  Where is DEREK DODOO?
 READING, UK
 United Kingdom
 DEREK DODOO
 Tags
Subject: RE: text file programming with CR LF
Thread ID: 143523 Message ID: 143537 # Views: 1 # Ratings: 1
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Wednesday, August 29, 2007 4:14:36 PM         
   


> **code CR & LF****possible codes
>
> >
> > Derek
> >
> > Could you upload a sample of what actually works. The COPY TO command puts a CR LF at the end of every record. It does not put a EOF at the end. Sometime you need an EOF at the end of the file. For that you have to give
> > STRTOFILE(lcContents+chr(26),'abc.txt')
> >
> > Sometimes you want only CR and not CRLF. For that you give
> > STRTOFILE(CHRTRAN(lcContents,CHR(10),""),"ABC.TXT")
> > This is mainly used by unix based OS.
> >
> > Or you may need to remove the LF and add the EOF.
> >
> > What you have given is a fixed length without anything at the end of record. I last saw that in the late 80s when it was used by COBOL.
> >
> > Regards
> > Tushar
>
> *******************************************************************************
> ****************************************************************************
>
> Within the
Scan... Endscan
can't we include the CR & LF as the last action before the next record is created, so as to avoid the use of the 'SDF' function, whilst bilding the text file.
>
> The CR LF will be embedded in the Scan..Endscan routine such that by the end the text file is created there will therefore not be the need for the undernoted:
>
>
SELECT SALARY_PAY
> 
>  	COPY TO ABC  TYPE  SDF

>
>
> Question..
>
> How will you code the CR AND LF as the last items in the
SCAN ENDSCAN
?
>
> Thanks

Derek

In the SCAN ... ENDSCAN you are entering data into a DBF file and not a text file. You shouldn't be entering CR and LF into a DBF field except in a memo file. The code for CR is chr(13) and of LF is chr(10).

If you upload a text file with a few records, we can tell you exactly what you require.

Regards
Tushar

ENTIRE THREAD

text file programming with CR LF Posted by DEREK DODOO @ 8/29/2007 3:03:31 PM
RE: text file programming with CR LF Posted by tushar @ 8/29/2007 3:14:16 PM
RE: text file programming with CR LF Posted by DEREK DODOO @ 8/29/2007 3:54:56 PM
RE: text file programming with CR LF Posted by tushar @ 8/29/2007 4:14:36 PM
RE: text file programming with CR LF Posted by Cetin Basoz @ 8/29/2007 5:01:46 PM
RE: text file programming with CR LF Posted by Ilya Rabyy @ 8/29/2007 5:10:45 PM