Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 23rd, 2007, 02:25 PM
pankaj_wolfhunter@yahoo.co.in
Guest
 
Posts: n/a
Default 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

  #2  
Old July 23rd, 2007, 04:35 PM
Dave Hughes
Guest
 
Posts: n/a
Default Re: Specifying Record Delimiter

pankaj_wolfhunter@yahoo.co.in wrote:
Quote:
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.

--

  #3  
Old July 23rd, 2007, 04:45 PM
pankaj_wolfhunter@yahoo.co.in
Guest
 
Posts: n/a
Default Re: Specifying Record Delimiter

On Jul 23, 8:33 pm, "Dave Hughes" <d...@waveform.plus.comwrote:
Quote:
pankaj_wolfhun...@yahoo.co.in wrote:
Quote:
Greetings,
Some time back I got some good advice from this group.
Again got stuck with something.
>
Quote:
I am using export utility to store data to flat files.
>
Quote:
For now I am using the following:
>
Quote:
EXPORT TO export_file_name OF DEL MODIFIED BY NOCHARDEL
TIMESTAMPFORMAT=\"MMM DD YYYY HH:MM:SS:UUTT\" COLDEL# select query
>
Quote:
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.

  #4  
Old July 27th, 2007, 04:05 PM
Ray
Guest
 
Posts: n/a
Default Re: Specifying Record Delimiter

On Jul 23, 10:38 am, "pankaj_wolfhun...@yahoo.co.in"
<pankaj_wolfhun...@yahoo.co.inwrote:
Quote:
On Jul 23, 8:33 pm, "Dave Hughes" <d...@waveform.plus.comwrote:
>
>
>
Quote:
pankaj_wolfhun...@yahoo.co.in wrote:
Quote:
Greetings,
Some time back I got some good advice from this group.
Again got stuck with something.
>
Quote:
Quote:
I am using export utility to store data to flat files.
>
Quote:
Quote:
For now I am using the following:
>
Quote:
Quote:
EXPORT TO export_file_name OF DEL MODIFIED BY NOCHARDEL
TIMESTAMPFORMAT=\"MMM DD YYYY HH:MM:SS:UUTT\" COLDEL# select query
>
Quote:
Quote:
Can I change the default (newline) record delimiter to something of my
own choice?
>
Quote:
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.
>
Quote:
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:
>
Quote:
input = open('export_file_name', 'rU')
output = open('export_file_name.conv', 'w')
for line in input:
output.write(line.rstrip('\n') + '\r\n')
>
Quote:
HTH,
>
Quote:
Dave.
>
Quote:
--
>
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.

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles