For Programmers: Free Programming Magazines  


Home > Archive > Clipper > October 2007 > Moving data from clipper table to a text file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Moving data from clipper table to a text file
AMOS

2007-10-10, 3:55 am

Hello to all,

I've to move data from clipper tables in a certain
system in the organization I'mworking for, to a text
file. The all data or part of it in this file is transferred
later to another system.that is not written in clipper.

Since I'm not familiar with clipper and I do not know
anyone in the organization that knows clipper, I'll be
very grateful if I get an answer to rhe two following
questions
- Is there a command in clipper I can type in a DOS
screen in order to get the structure of a certain table,
namely: the fields' names, their attributes and the
their length?
- I s there a possibility to write an external program
for example in C that reads the rows in a clipper table,
separates the row's data into fields and writes
it in a text file? If someone can supply to me an
example code or give me a link to an appropriate
site, I'll appreciate it.

I need an answer as soon as possible

Thank you in advance
Amos

Michael Baumann

2007-10-10, 3:55 am

Hello Amos,

Amos wrote:
> Hello to all,
>
> I've to move data from clipper tables in a certain
> system in the organization I'mworking for, to a text
> file. The all data or part of it in this file is transferred
> later to another system.that is not written in clipper.

I think you mean Files with extension .DBF, am I right?

You can export such DBF-Files with the clipper command COPY TO. See
http://www.ousob.com/ng/clguide/ng8258a.php

For long (memo fields) text be carefull to escape the delimiter
characters IN the text!

> - Is there a command in clipper I can type in a DOS
> screen in order to get the structure of a certain table,
> namely: the fields' names, their attributes and the
> their length?


COPY STRUCTURE [EXTENDED]
http://www.ousob.com/ng/clguide/ng81b99.php

> - I s there a possibility to write an external program
> for example in C that reads the rows in a clipper table,
> separates the row's data into fields and writes
> it in a text file?


Yes that is possible if you have a library (e.g. ODBC) for reading
DBF-structure. But you can export the data with clipper (see obove).

For more help I need more info about your tables and the format you
want for your migration.

HTH
Michael
Vienna/Austria/Europe

sebas22

2007-10-10, 3:55 am

On Tue, 09 Oct 2007 23:20:15 -0700, AMOS <am12348@walla.com> wrote:

>Hello to all,
>


>- Is there a command in clipper I can type in a DOS
> screen in order to get the structure of a certain table,
> namely: the fields' names, their attributes and the
>their length?


Yes,Dbu.exe is a file that is on your clipper folder, if clipper is
installed.

If it isn't you can find some free windows utilities that do the same
thing. Try a search with "wdbu" or "dbu windows" (dbu stands for
DataBase Utility)

If you really need a DOS tool, drop me a mail at
sbst_delete_this_first at yahoo dot com and I'll send you dbu.exe

>- I s there a possibility to write an external program
> for example in C that reads the rows in a clipper table,
> separates the row's data into fields and writes
>it in a text file? If someone can supply to me an
>example code or give me a link to an appropriate
>site, I'll appreciate it.


It is possible with C for sure, but you have to know the dbf structure
and use it to isolate each record. Although it's possible, you rather
use a clipper program, since clipper was made for it.

But the easiest way is to use the same utility, dbu.exe :
open your dbf file, open also the index if you want the result to be
sorted, then choose menu Utility / Copy.
Select SDF (copy with a fixed width for each field) or DELIMITED (that
gives you "fld1","fld2", ...), then choose the name of your output
file.

--
HTH
Sebas
SEI

2007-10-10, 3:55 am


Amos,

At this link you can download Advantage Data Architect Utility
(shortly ARC):

http://www.advantagedatabase.com/we...24F710D1A1CAD28

ARC is an interactive utility with GUI interface, lets you browse .dbf
tables and structures, and in TABLE menu's EXPORT option you can
choose to dump your .dbf tables in .txt, .CSV, .html, excel and other
file formats.

HTH

Ella


On 10 Oct, 09:20, AMOS <am12...@walla.com> wrote:
> Hello to all,
>
> I've to move data from clipper tables in a certain
> system in the organization I'mworking for, to a text
> file. The all data or part of it in this file is transferred
> later to another system.that is not written in clipper.
>
> Since I'm not familiar with clipper and I do not know
> anyone in the organization that knows clipper, I'll be
> very grateful if I get an answer to rhe two following
> questions
> - Is there a command in clipper I can type in a DOS
> screen in order to get the structure of a certain table,
> namely: the fields' names, their attributes and the
> their length?
> - I s there a possibility to write an external program
> for example in C that reads the rows in a clipper table,
> separates the row's data into fields and writes
> it in a text file? If someone can supply to me an
> example code or give me a link to an appropriate
> site, I'll appreciate it.
>
> I need an answer as soon as possible
>
> Thank you in advance
> Amos



N:dlzc D:aol T:com \(dlzc\)

2007-10-10, 6:55 pm

Dear AMOS:

"AMOS" <am12348@walla.com> wrote in message
news:1191997215.107695.141740@k79g2000hse.googlegroups.com...
> Hello to all,
>
> I've to move data from clipper tables in a certain
> system in the organization I'mworking for, to a text
> file. The all data or part of it in this file is transferred
> later to another system.that is not written in clipper.
>
> Since I'm not familiar with clipper and I do not know
> anyone in the organization that knows clipper, I'll be
> very grateful if I get an answer to rhe two following
> questions
> - Is there a command in clipper I can type in a DOS
> screen in order to get the structure of a certain table,
> namely: the fields' names, their attributes and the
> their length?


Clipper is not a command line program, it is a language compiler.
There are some programs that provide a command line, coded in
clipper, that provide such an interface.

If you have the clipper compiler:
use "SourceFile"
copy structure to "DestFile" delimited

> - I s there a possibility to write an external program
> for example in C that reads the rows in a clipper table,
> separates the row's data into fields and writes
> it in a text file? If someone can supply to me an
> example code or give me a link to an appropriate
> site, I'll appreciate it.


The most commonly available program to do this (without clipper)
is Micro$haft Excel.
Row one is the field names.
The column width of each populated column is the field length of
that field.
The format of row one for each column is the data type (number,
decimals)
.... but this fails if memo fields are used.

If you have the clipper compiler
use "SourceFile"
copy to "DestFile" delimited

Clipper only does 8.3 filenames, so be warned.

David A. Smith


sali

2007-10-10, 6:55 pm

"N:dlzc D:aol T:com (dlzc)" <dlzc1@cox.net> je napisao u poruci interesnoj
grupi:og4Pi.16473$054.14743@newsfe14.phx...
> Dear AMOS:
>
> "AMOS" <am12348@walla.com> wrote in message
> news:1191997215.107695.141740@k79g2000hse.googlegroups.com...
>
> The most commonly available program to do this (without clipper) is
> Micro$haft Excel.
> Row one is the field names.
> The column width of each populated column is the field length of that
> field.
> The format of row one for each column is the data type (number, decimals)
> ... but this fails if memo fields are used.
>
> David A. Smith


just to mention that excel is ok for quick data view, but it often does a
mess with character fields repersenting numbers, and doesn't support more
than 65000 rows [at least with my excel version]

if you have ms office [it is not hard to find] the best way is to use
access, it has option to link external clipper dbf tables, with 100%
accuracy, later you may do whatever you want with that table linked with
access as with any native access table


R. Totale

2007-10-10, 6:55 pm

On Wed, 10 Oct 2007 06:16:11 -0700, "N:dlzc D:aol T:com \(dlzc\)"
<dlzc1@cox.net> wrote:

>Dear AMOS:
>
>"AMOS" <am12348@walla.com> wrote in message
>news:1191997215.107695.141740@k79g2000hse.googlegroups.com...
[color=darkred]
>
>The most commonly available program to do this (without clipper)
>is Micro$haft Excel.


Borland C++ Builder (at least up to Version 5 and probably beyond) and
Delphi both include the Borland Database Engine, which is easy to
program in C++ or Pascal and can handle dbf/dbt files directly and
without the conversion errors one gets trying to manipulate them in
Excel. If the modern replacement for Turbo C++ Borland gives away has
this support that might be the way to go.


bill robertson

2007-10-10, 6:55 pm

"AMOS" <am12348@walla.com> wrote in message
news:1191997215.107695.141740@k79g2000hse.googlegroups.com...
> - I s there a possibility to write an external program
> for example in C that reads the rows in a clipper table,
> separates the row's data into fields and writes
> it in a text file? If someone can supply to me an
> example code or give me a link to an appropriate
> site, I'll appreciate it.
>

Hi Amos

I sent you a c program that will read a dbf file to your private mailbox. It
doesn't read any associated memo files but that is easily added. I have been
having tremendous problems with my service provider. It failed just as I was
sending you the files (dbf.c and db.h) so you may not receive them. Let me
know if this is the case. I compiled the files with borland's free c/c++
compiler but the source is standard c so any c compiler should work ok.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com