Re: Working with a tab-delimited input file
From: TofuTheGreat (member46811_at_dbforums.com)
Date: 11/04/03
- Next message: JerryMouse: "Re: Working with a tab-delimited input file"
- Previous message: Kevin Hansen: "Re: need help with Norcom's GUIscreenio and Netexpress"
- In reply to: TofuTheGreat: "Working with a tab-delimited input file"
- Next in thread: TofuTheGreat: "Re: Working with a tab-delimited input file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 04 Nov 2003 16:46:12 -0500
Originally posted by Thane Hubbell
> First, let me confess to NOT reading the intervening replies.
> I would suggest not messing with the expandtab - you don't want to
> expand them, you want to use them as field delimiters.
> However, - you can't read the file with a "line sequential"
> organization because the tabs will get expanded and you can't use them
> that way. (Though the Expandtab directive "should" cure that - I
> never had much luck that way either).
> So - here's what I did when I ran into this. I preprocessed the file.
> I opened it with access SEQUENTIAL for I-O. Then define the record as
> ONE BYTE. Then do this:
>
> Perform until all-done
> Read input-file
> at end
> set all-done to true
> not at end
> perform process-record
> end-read
> end-perform
> .
> process-record.
> If input-record = X"09"
> move X"FF" to input-record
> rewrite input-record
> end-if
> .
>
> Then use line sequential organization to read the file and unstring
> delimited by X"FF".
> If you don't like using X"FF" you could use "~" provided there are not
> any tildes in your input data.
>
Excellent suggestion. I'll give this one a try! This is similar
(though much simpler and more elegant) to something I was
contemplating doing.
[UPDATED]
DUH moment here for me. The problem is happening when I do the actual
READ. At the read the tab character (x"09") is being replaced by
padding spaces. I can't use spaces as the delimiter since some of the
fields (i.e. addresses) will contain spaces.
The EXPANDTAB=OFF is supposed to suppress this behavior but isn't
working right. If it was then my problems would be solved. It's
looking more and more like I'm going to have to code either an
Excel/Word macro or a stand-alone VB program for the users to pre-
process the stupid file. I can hear the bitching now.....
-- Posted via http://dbforums.com
- Next message: JerryMouse: "Re: Working with a tab-delimited input file"
- Previous message: Kevin Hansen: "Re: need help with Norcom's GUIscreenio and Netexpress"
- In reply to: TofuTheGreat: "Working with a tab-delimited input file"
- Next in thread: TofuTheGreat: "Re: Working with a tab-delimited input file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|