By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,611 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,611 IT Pros & Developers. It's quick & easy.

Specifying Record Delimiter

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.