467,154 Members | 799 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,154 developers. It's quick & easy.

Specifying Record Delimiter

Greetings,
Some time back I got some good advice from this group.
Again got stuck with something.

I am using export utility to store data to flat files.

For now I am using the following:

EXPORT TO export_file_name OF DEL MODIFIED BY NOCHARDEL
TIMESTAMPFORMAT=\"MMM DD YYYY HH:MM:SS:UUTT\" COLDEL# select query

Can I change the default (newline) record delimiter to something of my
own choice?

Any help would be appreciated.

TIA

Jul 23 '07 #1
  • viewed: 6329
Share:
3 Replies
pa***************@yahoo.co.in wrote:
Greetings,
Some time back I got some good advice from this group.
Again got stuck with something.

I am using export utility to store data to flat files.

For now I am using the following:

EXPORT TO export_file_name OF DEL MODIFIED BY NOCHARDEL
TIMESTAMPFORMAT=\"MMM DD YYYY HH:MM:SS:UUTT\" COLDEL# select query

Can I change the default (newline) record delimiter to something of my
own choice?
As far as I can tell: no, you can't change the row delimiter (only the
column and string delimiters). If you're on Linux you could always use
the dos2unix / unix2dos utilities to convert the file afterward
(sometimes these are called d2u or u2d). There's probably Windows
versions of these too, somewhere.

Alternatively you could write a quick script to handle the conversion.
For example, under Python, the following would do the trick to convert
to DOS (CRLF) line endings:

input = open('export_file_name', 'rU')
output = open('export_file_name.conv', 'w')
for line in input:
output.write(line.rstrip('\n') + '\r\n')
HTH,

Dave.

--

Jul 23 '07 #2
On Jul 23, 8:33 pm, "Dave Hughes" <d...@waveform.plus.comwrote:
pankaj_wolfhun...@yahoo.co.in wrote:
Greetings,
Some time back I got some good advice from this group.
Again got stuck with something.
I am using export utility to store data to flat files.
For now I am using the following:
EXPORT TO export_file_name OF DEL MODIFIED BY NOCHARDEL
TIMESTAMPFORMAT=\"MMM DD YYYY HH:MM:SS:UUTT\" COLDEL# select query
Can I change the default (newline) record delimiter to something of my
own choice?

As far as I can tell: no, you can't change the row delimiter (only the
column and string delimiters). If you're on Linux you could always use
the dos2unix / unix2dos utilities to convert the file afterward
(sometimes these are called d2u or u2d). There's probably Windows
versions of these too, somewhere.

Alternatively you could write a quick script to handle the conversion.
For example, under Python, the following would do the trick to convert
to DOS (CRLF) line endings:

input = open('export_file_name', 'rU')
output = open('export_file_name.conv', 'w')
for line in input:
output.write(line.rstrip('\n') + '\r\n')

HTH,

Dave.

--
Thanks Dave.
Even I figured out after googling that we might not able to define a
row delimiter.
Just wanted to confirm. I already wrote a script on unix side to
handle the conversion.
Thanks again.

Jul 23 '07 #3
Ray
On Jul 23, 10:38 am, "pankaj_wolfhun...@yahoo.co.in"
<pankaj_wolfhun...@yahoo.co.inwrote:
On Jul 23, 8:33 pm, "Dave Hughes" <d...@waveform.plus.comwrote:
pankaj_wolfhun...@yahoo.co.in wrote:
Greetings,
Some time back I got some good advice from this group.
Again got stuck with something.
I am using export utility to store data to flat files.
For now I am using the following:
EXPORT TO export_file_name OF DEL MODIFIED BY NOCHARDEL
TIMESTAMPFORMAT=\"MMM DD YYYY HH:MM:SS:UUTT\" COLDEL# select query
Can I change the default (newline) record delimiter to something of my
own choice?
As far as I can tell: no, you can't change the row delimiter (only the
column and string delimiters). If you're on Linux you could always use
the dos2unix / unix2dos utilities to convert the file afterward
(sometimes these are called d2u or u2d). There's probably Windows
versions of these too, somewhere.
Alternatively you could write a quick script to handle the conversion.
For example, under Python, the following would do the trick to convert
to DOS (CRLF) line endings:
input = open('export_file_name', 'rU')
output = open('export_file_name.conv', 'w')
for line in input:
output.write(line.rstrip('\n') + '\r\n')
HTH,
Dave.
--

Thanks Dave.
Even I figured out after googling that we might not able to define a
row delimiter.
Just wanted to confirm. I already wrote a script on unix side to
handle the conversion.
Thanks again.
I highly recommend you get a good editor to use on the DOS side that
can do all this stuff transparently. I use a Java-based editor called
jEdit that has an FTP plugin that lets you treat FTP like another file
system.

Jul 27 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Raquel | last post: by
3 posts views Thread by Jacek Dziedzic | last post: by
3 posts views Thread by chudson007@hotmail.com | last post: by
13 posts views Thread by sonald | last post: by
6 posts views Thread by chrispwd@gmail.com | last post: by
7 posts views Thread by Johny | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.