Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to increase limit of SDF while appending from a text file?

Status
Not open for further replies.

Wescoosoft

Programmer
Oct 1, 2002
10
0
0
US
I have a database and went to perform a

append from file.txt fields x, y, z (etc.) sdf

The problem is the last field added to the text file is
not appended in the appropriate field. All others are
fine. Is there a system file within the BIN directory
that needs to be edited before rebuilding the program?
I recall Clipper having a 2048 field limit while appending
from a text file. I'm lost as to why the last field doesn't
come in. When you specify fields in the append statement,
does it have to be in order?
 
From the NG for APPEND FROM:

SDF identifies a System Data Format ASCII file. Records and fields are fixed length.
...
SDF Text File Format Specifications
--------------------------------------------------------
File Element Format
--------------------------------------------------------
Character fields Padded with trailing blanks
Date fields yyyymmdd
Logical fields T or F
Memo fields Ignored
Numeric fields Padded with leading blanks or zeros
Field separator None
Record separator Carriage return/linefeed
End of file marker 1A hex or CHR(26)
--------------------------------------------------------



Your txt file must match the structure of the database file (or the fields specified) EXACTLY. Check the length of the previous field in the txt file.

So if your db was:
Name c 7
Age n 3
Married l 1

Then a SDF file should be:
12345678901
George 18T
Wendy 24F
Michael100T

Note that the fields run-into-each-other, i.e. no padding.

Hope that helps.
 
Ok. I didn't think to check the previous field. I was so wrapped up in the field that
didn't get appended. Thanks.
 
Is there an entry in a Clipper system file that would limit
the number of fields that appends in with the SDF? The reason I ask is I recall seeing something about an array the SDF uses when loading data in from a text file to s
database.


 
From the NG:

APPEND FROM
Import records from a (.dbf) or ASCII file
--------------------------------------------------------
Syntax

APPEND FROM <xcFile>
[FIELDS <idField list>]
[<scope>] [WHILE <lCondition>] [FOR <lCondition>]
[SDF | DELIMITED [WITH BLANK | <xcDelimiter>]]


I have not tried it, but I would guess if you specify FIELDS <field list> then only those fields will be imported, but your data must match the fields and order specified.

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top