×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How i can include a tittle line with the names of fields ?

How i can include a tittle line with the names of fields ?

How i can include a tittle line with the names of fields ?

(OP)
Hi, i have to convert a dbf file into a csv archive but the first line must have the names of every field. How i could do this file ?. Help please.
The csv file appears with the content of fields correctly but i don't know how to include a header with the names o fields.

Thanks

RE: How i can include a tittle line with the names of fields ?

Hi Capri,

CODE

USE some.dbf
copy to some.csv type csv 
does that

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: How i can include a tittle line with the names of fields ?

A glance at the VFP Help will tell you that the CSV format has the field names embedded:

From the Help for COPY TO ... TYPE CSV:

Quote:

Creates a comma separated value file. A CSV file has the field names as the first line in the file, and the field values in the remainder of the file are separated with commas

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How i can include a tittle line with the names of fields ?

Watch out for memo fields... they are not included and you did say 'every field'

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: How i can include a tittle line with the names of fields ?

Olaf, one very small error in your code:

For the logical case (lcType = 'L'), I think the comment should say && process logical Fields rather than && process numeric Fields.

It doesn't affect your logic, of course.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How i can include a tittle line with the names of fields ?

That's fixed. Thanks, Mike.

I now also changed it to a function with usage code. There's still some room for improvement and adaption, like not outputting field by field, but actually there is enough caching of filesystem and drive hardware so the output is similarly fast to COPY TO or EXPORT.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close