Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Flat file creation problems

Re: Flat file creation problems

From: Steve McDaniels <steve.mcdaniels_at_sierra.com>
Date: Mon, 24 Jan 2000 16:21:26 -0800
Message-ID: <86iqi7$qjv$1@plo.sierra.com>


Consider:

Last name = O'Brian
(...so, ah, we can't use the apostrophe to delimit fields)

Address = 123 1/2 CALLE DON DIEGO (Puerto Rico and U.S. addresses may have slashes and or hyphens)
(...so, ah, we can't use slash to delimit fields)

Particularly where collecting data directly from web page forms, users sometimes
press control-tab rather than just TAB to move to next field. Tab gets entered. (I wonder
what happens when CTRL-ENTER is pressed) (...so, ah, we can't use tab)

Organization: "ABC" Car Rentals
(...so, ah, we can't use double quotes)

Obviously, space as a delimiter is rarely a good idea.

etc.

In our organization, we capture some 1 meg of these "dirty" (expletive deleted) records,
and produce a file which is processed by an external system for hygiene. Since we
cannot guarantee any given character (for use as the delimiter) won't appear in the
data, we use your type 1 file (fixed field length, fixed record length).

RTRIM
You're right about this.
Better: Use the SQL*PLUS set command to turn off spacing (set space 0)

Kenneth C Stahl <BlueSax_at_Unforgetable.com> wrote in message news:38885533.D0D32967_at_Unforgetable.com...
> Steve McDaniels wrote:
> >
> > I would NOT use a separator because one cannot guarantee that the
separator
> > is not part of the data.
> >
> > Try something like RTRIM on the offending field(s)
> >
> > select rtrim(column1) a, ...
> >
> How do you know that spaces won't be part of the value? You can't just
> flatly say that no one should use delimiters since they may be part of the
> daya.
>
> Flat files have been used since the earliest days. There are two basic
> types of flat files:
>
> 1. SDF (Standard Delimited Files). In the olden days these were often
> called card image files because the physical record length was 80
> characters - the number of characters that could be entered on a punch
> card. If the logical record spanned more than one physical record, then
> some type of continuation character was used to logically join the two
> records. Every field in the record was assigned a specific length and
> therefore you could always know that a field would span specific columns.
> Strings were left justified. Numbers were right justified.
>
> 2. Delimited files. The data fields in these files are separated by a
> pre-determined delimiter. Because certain windows applications have a
> strong preference for data delimited by commans there is even a
> sub-catetory that many people are now familiary with - CSV (Comma
Seperated
> Values). The practice of using a delimited file is widely accepted and as
> long as the delimiter does not appear in the data then it will cause no
> problem in usage. The individuals who work with the data for any
individual
> application are the best positioned to determine what printable characters
> would not appear in the data.
>
> For someone to just blanketly say "I would NOT use a separator because one
> cannot guarantee that the separator is not part of the data." demonstrates
> that they are just mere amateurs in the data processing world.
Received on Mon Jan 24 2000 - 18:21:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US