Q: Importing data and record-layout requirements 
Author Message
 Q: Importing data and record-layout requirements

I have to write a file which is to be imported into FOXPRO.
I can create the "quoted-strings-with-comma-as-separator" fields, e.g.

   "123","45","67"

but my problem is that I have about 300 columns per record,
yet have a limitation that I cannot write records "wider" than 80
columns.

So, will FOXPRO handle correctly handle data like:

  "11",
     "12","13"
  "21","22",
     "23"

to create a file like:

   11 12 13   <- first record
   21 22 23   <- next record

or will it create:

    11     <- first record
    12  13 <- second record
    21  22 <- third record
    23    <- fourth record

Is there some other way to mark "continuation" lines in the
imported-data ?

Thanks!



Mon, 28 Aug 2000 03:00:00 GMT  
 Q: Importing data and record-layout requirements

Melvin,
First using the standard inport command the answer is no, this is not
possible, but using low level file IO you could do most of it. The reason
for the "most", is that FP has a limitation of 255 fields per record -
you'll have to work with multiple linked tables to handle 300 fields. That
being said, you may want to normalize this data, I've never found the need
for that many fields in a table.

Rick


Quote:
>I have to write a file which is to be imported into FOXPRO.
>I can create the "quoted-strings-with-comma-as-separator" fields, e.g.

>   "123","45","67"

>but my problem is that I have about 300 columns per record,
>yet have a limitation that I cannot write records "wider" than 80
>columns.

>So, will FOXPRO handle correctly handle data like:

>  "11",
>     "12","13"
>  "21","22",
>     "23"

>to create a file like:

>   11 12 13   <- first record
>   21 22 23   <- next record

>or will it create:

>    11     <- first record
>    12  13 <- second record
>    21  22 <- third record
>    23    <- fourth record

>Is there some other way to mark "continuation" lines in the
>imported-data ?

>Thanks!



Mon, 28 Aug 2000 03:00:00 GMT  
 Q: Importing data and record-layout requirements

Melvin,
The 300 columns per record indicates that you have some sort of statistical
crossreference table, not a normalized relational table.  FoxPro stops at
254 columns, as does Access and Excel.
You can easily open this file in FoxPro though with FOPEN() and read each
line of text, parse and copy it into several tables that you can then link
to each other. But you need to analyse the data and decide what goes where.

Here's an example of what I mean.
Rule 1 of the 3 basic normalization rules: no repeating fields!

CREATE TABLE data1 (customer I, week1 n(5), week2 n(5) ,,,, week52 n(5))
  111, 4556, 5672, 12, ..... , 678
change to
CREATE TABLE data2 (customer Integer,. week N(2), amount N(5))
111, 1, 4556
111, 2, 5672
111, 3, 12
...
111, 52, 678

53 columns reduced to 3.

-Anders


Quote:
>I have to write a file which is to be imported into FOXPRO.
>I can create the "quoted-strings-with-comma-as-separator" fields, e.g.

>   "123","45","67"

>but my problem is that I have about 300 columns per record,
>yet have a limitation that I cannot write records "wider" than 80
>columns.

>So, will FOXPRO handle correctly handle data like:

>  "11",
>     "12","13"
>  "21","22",
>     "23"

>to create a file like:

>   11 12 13   <- first record
>   21 22 23   <- next record

>or will it create:

>    11     <- first record
>    12  13 <- second record
>    21  22 <- third record
>    23    <- fourth record

>Is there some other way to mark "continuation" lines in the
>imported-data ?

>Thanks!



Mon, 28 Aug 2000 03:00:00 GMT  
 Q: Importing data and record-layout requirements

imported records are normally terminated with the cr/lf characters ascii
10 & 13, you can keep track of the number of fields you have imported and
keep 'virtual' track of as many actual incomming lines it takes to make up
you records.  Your result file will depend on the position of the import
file line delimiters.  See append in the help and insert-sql.

Quote:

> I have to write a file which is to be imported into FOXPRO.
> I can create the "quoted-strings-with-comma-as-separator" fields, e.g.

>    "123","45","67"

> but my problem is that I have about 300 columns per record,
> yet have a limitation that I cannot write records "wider" than 80
> columns.

> So, will FOXPRO handle correctly handle data like:

>   "11",
>      "12","13"
>   "21","22",
>      "23"

> to create a file like:

>    11 12 13   <- first record
>    21 22 23   <- next record

> or will it create:

>     11     <- first record
>     12  13 <- second record
>     21  22 <- third record
>     23    <- fourth record

> Is there some other way to mark "continuation" lines in the
> imported-data ?

> Thanks!



Tue, 29 Aug 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Urgent qs for guru's:Record is not locked

2. QUESTION: Making a record inherit data from another record

3. Qs: cursors and putfile()

4. Easy Qs: ERROR clause and the WAIT WINDOW

5. VFP Couple of form Qs

6. Missing records when IMPORTing a Paradox table

7. Paradox import missing records

8. Foxprod Dos 2.6 Report writer Qs.

9. how to import fixed length record from text files

10. Import data from com1

11. Importing data from Excel (.XLS)

12. Importing Access Data

 

 
Powered by phpBB® Forum Software