473,382 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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
3 6915
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Raquel | last post by:
Could someone explain to me what the reason is for having a character delimiter (which is double quotes by default) for performing Loads/Imports on UDB? I would think that column delimiter along...
3
by: Jacek Dziedzic | last post by:
Hello! Suppose I'm writing a library to write a binary representation of some data to a stream. Let's say that to make it extensible in the future I'm preceding the actual data with some info...
2
by: Deano | last post by:
Problem is that there are lots and lots of fields in an employee record. I specify a form control as the criterion for one of those fields which is the value of the primary key for that record. ...
3
by: chudson007 | last post by:
Can somebody help me with a delimiter problem I have. I have several PIPE (|) delimted text files which I need to import to SQL. With one of the files I keep encountering the following error;...
13
by: sonald | last post by:
Hi, Can anybody tell me how to change the text delimiter in FastCSV Parser ? By default the text delimiter is double quotes(") I want to change it to anything else... say a pipe (|).. can anyone...
11
by: Timofmars | last post by:
I'm try to Unload DB2 data from a table into a record sequential file on NT. I can an unload on Mainframe, but it doesn't seem to be an option in NT. In NT, all I can do is export/import. I can...
6
by: chrispwd | last post by:
Hello, I have a situation where I have a file that contains text similar to: myValue1 = contents of value1 myValue2 = contents of value2 but with a new line here myValue3 = contents of...
7
by: Johny | last post by:
Is it possible to change record separator when using readline? As far as I know readline reads characters until found '\n' and it is the end of record for readline. My problem is that my record...
0
by: rahulj | last post by:
Some of the queries, in our application, have trailing semicolon which works fine when the application uses DB2 CLI Native Driver. But when the driver is changed to DB2 Type 4 Universal Driver an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.