Don't duplicate the (meta)data as data, as that will come back to bite
you the first time you add or rename a field, or set a filter on the
table data and forget to do the same to the metadata.
There's a couple ways to do this. You could use AFIELDS to get all the
fieldnames and then generate a string, or you could hack an existing
function to do the list for you...
I did this for a client recently, and ended up doing something like
(no errors in Gmail!):
#DEFINE COMMA ","
#DEFINE SPACE " "
#DEFINE CRLF CHR(13)+CHR(10)
COPY TO header.csv TYPE CSV WHERE .F. && gets you just a header record
COPY TO tempfile.txt DELIMITED WITH "" SEPARATED WITH CRLF
string1 = strtran(FileToStr("header.csv"), COMMA, SPACE)
string2 = FileToStr("tempfile.txt")
output = StrToFile(string1+CRLF+string2, "output.txt")
On Mon, Jun 13, 2016 at 4:18 PM, Desmond Lloyd <[email protected]> wrote:
> Good afternoon,
>
> Am outputing a text file type delimited with character "" character tab,
> works great. The table it is being generated from is a mix of character
> and numeric fields...
>
> The only issue I have is that they wnat the fields names to make up the
> first record. My original throught was to build a separate table with the
> fields names entered in the record (one record) and then append from my
> file. This would put the field names up top and the rest of the data after
> that. Am concerned about adding the previously numeric fields as a
> character field.
>
> Any suggestions?
> TIA,
> Desmond
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/CACW6n4sYrVP0UquzzkOnnjxhQH1bKTmkvm2=yoa2kt-nxof...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.