Re: SQL to file

From: Cindy Winegarden (cindy.winegarden_at_mvps.org)
Date: 05/05/04


Date: Wed, 5 May 2004 16:16:47 -0400

In news: OB3z7PrMEHA.936@TK2MSFTNGP11.phx.gbl,
Mike Hunt <nojunk@please.com> wrote:
> SELECT field1, field2, field3 FROM mytable TO FILE myfile NOCONSOLE
> PLAIN
>
> The problem is it is leaving first two lines in "myfile.txt" ...
> I don't want any empty lines to be left,

Hi Mike,

The following should get you started:

Create Cursor Test (Field1 C(10), Field2 C(10), Field3 C(10))
Insert Into Test Values ("Tom", "Dick", "Harry")
Insert Into Test Values ("Hewey", "Dewey", "Louie")

SELECT ;
    Field1, ;
    Field2, ;
    Field3 ;
FROM ;
    Test ;
To File C:\TestFile.txt NoConsole Plain

StrToFile(Substr(FileToStr("C:\TestFile.txt"), 5), "C:\TestFile.txt")
Modify File C:\TestFile.txt

- or -

Copy To C:\TestFile2.txt Type SDF

-- 
Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org  www.cindywinegarden.com