Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Contractors
#10
Actually, the government of the US has as far back as I can remember used text fields (full ASCII files), often of various lengths for numeric data.
Pure binary files are used as well, but are less often seen in public data, unless specifically targeted for developers.

A search for 'data types used in files' on the catalog.data.gov returns

130,028 datasets found for "data types used in files"

I found that it varies from group to group.
Here's a sample of a part of a typical  public record layout (I have it in a dictionary for my application)

            'VotingDistricts': {
                'GEOID': {
                    'length': '11',
                    'type': 'String',
                    'description': 'Voting district identifier; a concatenation of the '
                                   'state FIPS code, county FIPS code, and voting district'
                                   'code'
                },
                'VTDI': {
                    'length': '1',
                    'type': 'String',
                    'description': '2010 Census voting district indicator'
                },
                'NAMELSAD10': {
                    'length': '100',
                    'type': 'String',
                    'description': '2010 Census name and the translated legal/statistical '
                                   'area description for voting district'
                },
                'LSAD10': {
                    'length': '2',
                    'type': 'String',
                    'description': '2010 Census legal/statistical area description code for '
                                   'voting district'
                },
                'ALAND10': {
                    'length': '14',
                    'type': 'Number',
                    'description': '2010 Census land area'
                },
                'AWATER10': {
                    'length': '14',
                    'type': 'Number',
                    'description': '2010 Census water area'
                },
                'INTPTLAT10': {
                    'length': '11',
                    'type': 'String',
                    'description': '2010 Census latitude of the internal point'
                },
                'INTPTLON10': {
                    'length': '12',
                    'type': 'String',
                    'description': '2010 Census longitude of the internal point'
                }
            },
Note the two Number data types.
This is not unlike storing a numeric field in a database varchar or varchar2 field

Oracle's definition is:

Quote:The VARCHAR2 datatype stores variable-length character strings. When you create a table with a VARCHAR2 column, you specify a maximum column length (in bytes, not characters) between 1 and 2000 for the VARCHAR2 column. For each row, Oracle stores each value in the column as a variable-length field (unless a value exceeds the column's maximum length and Oracle returns an error). For example, assume you declare a column VARCHAR2 with a maximum size of 50 characters. In a single-byte character set, if only 10 characters are given for the VARCHAR2 column value in a particular row, the column in the row's row piece only stores the 10 characters (10 bytes), not 50.
Reply


Messages In This Thread
Contractors - by ichabod801 - Jan-31-2017, 05:26 PM
RE: Contractors - by Ofnuts - Jan-31-2017, 06:27 PM
RE: Contractors - by ichabod801 - Jan-31-2017, 06:53 PM
RE: Contractors - by micseydel - Jan-31-2017, 10:11 PM
RE: Contractors - by ichabod801 - Feb-02-2017, 11:04 PM
RE: Contractors - by Skaperen - Feb-05-2017, 07:32 AM
RE: Contractors - by ichabod801 - Feb-05-2017, 11:30 AM
RE: Contractors - by Ofnuts - Feb-06-2017, 10:08 AM
RE: Contractors - by Skaperen - Feb-06-2017, 05:01 AM
RE: Contractors - by Larz60+ - Feb-06-2017, 11:05 AM
RE: Contractors - by ichabod801 - Feb-06-2017, 04:20 PM
RE: Contractors - by Larz60+ - Feb-06-2017, 06:28 PM
RE: Contractors - by wavic - Feb-06-2017, 06:47 PM
RE: Contractors - by Larz60+ - Feb-06-2017, 07:23 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020