Export fixed length
scooter6 at gmail.com
scooter6 at gmail.com
Thu Aug 11 07:18:29 PDT 2011
Thanks - that works too -- didn't realize you needed the new line before
the -x
One more thing - how do you 'left justify, blank fill' a field?
I created a Global edit as such:
LJ = {#}\ \ <-- hoping the space between the \ would create
blanks after the numbers
I'm creating a file that is fixed length - but the field can be a variety
of numbers long -- but the fixed length is 17 characters
So I need to left justify, blank fill this field.....
That edit didn't work.......anyone have syntax for a left justify field?
Scott
On Wed, Aug 10, 2011 at 6:03 PM, Kenneth Brody <KandLBrody at gmail.com> wrote:
> On 8/10/2011 5:06 PM, Mike Schwartz wrote:
> >> Trying to create an export (fixed length) using following syntax:
> >>
> >> export ascii ach=/appl/fpmerge/achtest.txt -X r=\n
> >>
> >> then do all my field assignments, etc
> >>
> >> ach(1)=1;ach(2)=2...etc
> >>
> >> When the file is created it's not adding a line feed after each record?
> >>
> >> I have tried with and without the r=\n ??
> >>
> >> When looking at the output file, it just lists the records one after the
> > other
> >>
> >> i.e. file looks like:
> >>
> >> 627065400153 45496004627314074269 104280298
> >> ^ new record should start
> here
> >>
> >> Should look like:
> >>
> >> 627065400153 45496004
> >> 627314074269 104280298
> >>
> >> Why is it not adding the line feed?
> >>
> >> Thanks for any insight
> >>
> >> Scott
> >
> > With the -X option, as I recall, you have to add your own carriage
> > return/linefeed (or whatever you want to terminate each record with)
> > yourself.
> >
> > For example, you need a line like:
> >
> > ach(10)=chr("13") {chr("10")
> >
> > at the end of the fields you are writing, if you want a DOS
> formatted
> > file.
>
> Note that, on Windows, that will get you a double-spaced file. And, on
> *nix, this will give you a file with a spurious Ctrl-M at the end of each
> line. All you want is CHR("10").
>
> However, you shouldn't need that at all, as the following works just fine
> for me:
>
> ==========
> Then: export ascii foo = /temp/foo.txt r=\n -x
> Then: foo[1] = 1
> Then: foo[2] = 2
> Then: foo[3] = 3
> ==========
>
> This gives me the following output:
>
> ==========
> Brody Ken 11/17/2009
> smith john 11/21/2009
> obama barack 06/21/2010
> smith john 06/21/2010
> ==========
>
> --
> Kenneth Brody
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20110811/76087a7d/attachment.html
More information about the Filepro-list
mailing list