VFP 3.0 Append from fixed ascii 
Author Message
 VFP 3.0 Append from fixed ascii

This is probably an easy one, but I think I've tried everything.  I simply
need to append data from a fixed ascii file with no delimiters into a table
with multiple fields.  I know the starting points and data lengths ahead of
time.  I know this is available through the import wizard, but how can I
automate it so I don't have to use the import wizard each time I want to
append data.  I used to just bring all of the information into the first
field of the record (254 characters long) and use the substr command to
split it out into the required fields.  But now I've come across a file that
is more than 254 characters per record and I need to append to a table
several times a day.

Any ideas..??.  "besides a macro that inserts commas into the text file"..
I'm hoping there is an easier way...

Todd



Fri, 27 Oct 2000 03:00:00 GMT  
 VFP 3.0 Append from fixed ascii

I figured it out..  append from <text file> type SDF.  But I would also like
to split the data from one record into many records.  One record would have
the following information.

(Record #1) date type description date type description date type
description date type... and so on

Is there an easy way to split that data into many records such as

(Record #1) date type description
(Record #2) date type description
(Record #3) date type description
...and so on.

Todd

Quote:

>This is probably an easy one, but I think I've tried everything.  I simply
>need to append data from a fixed ascii file with no delimiters into a table
>with multiple fields.  I know the starting points and data lengths ahead of
>time.  I know this is available through the import wizard, but how can I
>automate it so I don't have to use the import wizard each time I want to
>append data.  I used to just bring all of the information into the first
>field of the record (254 characters long) and use the substr command to
>split it out into the required fields.  But now I've come across a file
that
>is more than 254 characters per record and I need to append to a table
>several times a day.

>Any ideas..??.  "besides a macro that inserts commas into the text file"..
>I'm hoping there is an easier way...

>Todd



Fri, 27 Oct 2000 03:00:00 GMT  
 VFP 3.0 Append from fixed ascii

Hi Todd,

Do the append as you worked out, then do a SQL statement like:

SELECT DatetypeField1 as DateTypeField, DescriptionField1 as
DescriptionField ;
    FROM (YourRecentlyCreatedDBF)
UNION
SELECT DatetypeField2 as DateTypeField, DescriptionField2 as
DescriptionField ;
    FROM (YourRecentlyCreatedDBF)
UNION
...
INTO TABLE (YourNewDBFName)

Cheers,

Andrew

Quote:

>I figured it out..  append from <text file> type SDF.  But I would also
like
>to split the data from one record into many records.  One record would have
>the following information.

>(Record #1) date type description date type description date type
>description date type... and so on

>Is there an easy way to split that data into many records such as

>(Record #1) date type description
>(Record #2) date type description
>(Record #3) date type description
>...and so on.

>Todd


>>This is probably an easy one, but I think I've tried everything.  I simply
>>need to append data from a fixed ascii file with no delimiters into a
table
>>with multiple fields.  I know the starting points and data lengths ahead
of
>>time.  I know this is available through the import wizard, but how can I
>>automate it so I don't have to use the import wizard each time I want to
>>append data.  I used to just bring all of the information into the first
>>field of the record (254 characters long) and use the substr command to
>>split it out into the required fields.  But now I've come across a file
>that
>>is more than 254 characters per record and I need to append to a table
>>several times a day.

>>Any ideas..??.  "besides a macro that inserts commas into the text file"..
>>I'm hoping there is an easier way...

>>Todd



Sat, 28 Oct 2000 03:00:00 GMT  
 VFP 3.0 Append from fixed ascii

Quote:

> This is probably an easy one, but I think I've tried everything.  I simply
> need to append data from a fixed ascii file with no delimiters into a table
> with multiple fields.  I know the starting points and data lengths ahead of
> time.  I know this is available through the import wizard, but how can I
> automate it so I don't have to use the import wizard each time I want to
> append data.  I used to just bring all of the information into the first
> field of the record (254 characters long) and use the substr command to
> split it out into the required fields.  But now I've come across a file that
> is more than 254 characters per record and I need to append to a table
> several times a day.

> Any ideas..??.  "besides a macro that inserts commas into the text file"..
> I'm hoping there is an easier way...

> Todd

  Make sure the fields in your table are in the same order and of the same size
as the date in the text file and then use

APPEND FROM <text file name> TYPE SDF



Sat, 28 Oct 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Report To File ASCII bug in VFP 3.0?

2. Export records from VFP 3.0 table to FIXED WIDTH format

3. STRTRAN() to fix ASCII: Error 1903: String is too long to fit

4. Bring in Fixed Length ASCII file?

5. ASCII fixed field length format?

6. How do I save a table as a fixed length ASCII file

7. Importing excell spreadsheet - exporting ASCII fixed width file

8. vfp 3.0 -- APPEND FROM...

9. Auto appending records in VFP 3.0

10. Read/append records from ASCII file?

11. HELP - Appending ASCII file into Foxpro DBF

12. Appending text files with fixed width format

 

 
Powered by phpBB® Forum Software