parse copy.out output as plain text?

This is a discussion on parse copy.out output as plain text? within the Ingres Database forums in Other Databases category; I wish to parse out an Ingres data copy (with sql db_name < copy.out > file; where copy.out is generated with copydb command). I wonder could someone advice what's the delimiter and line breaks used in such Ingres copy file, so I can write a perl script to convert data into plain text file? I see irregular ^A and spaces but can't match up where the line breaks should be, or tell what they are. Or the unix terminal is fooling my eyes ;-) Thanks in advance! Zhiliang...

Go Back   Database Forum > Other Databases > Ingres Database

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-22-2008, 11:04 PM
Default parse copy.out output as plain text?

I wish to parse out an Ingres data copy (with sql db_name < copy.out
> file; where "copy.out" is generated with "copydb" command). I

wonder could someone advice what's the delimiter and line breaks used
in such Ingres copy
file, so I can write a perl script to convert data into plain text
file?

I see irregular "^A" and spaces but can't match up where the line
breaks should be, or tell what they are. Or the unix terminal is
fooling my eyes ;-)

Thanks in advance!

Zhiliang
Reply With Quote
  #2  
Old 08-24-2008, 03:38 PM
Default Re: parse copy.out output as plain text?

Hi Zhiliang

You should use the copydb command with a -c switch. This way you
will have an open format file (tab delimited) which is easy to parse.
Read the "command & reference" guide for the copydb command and the
SQL guide (copy statement) for figuring out what the copy.out file
contains (and the text file it builds - especially varchar types
etc..)

Hope this helps.

Gary
Reply With Quote
  #3  
Old 08-28-2008, 05:42 PM
Default Re: parse copy.out output as plain text?

On Aug 24, 1:38 pm, ghing...@yahoo.co.uk wrote:
> HiZhiliang
>
> You should use the copydb command with a -c switch. This way you
> will have an open format file (tab delimited) which is easy to parse.
> Read the "command & reference" guide for the copydb command and the
> SQL guide (copy statement) for figuring out what the copy.out file
> contains (and the text file it builds - especially varchar types
> etc..)
>
> Hope this helps.
>
> Gary


Thanks Gary, that is useful.
However in our case we only have a backup copy from a time point that
were saved with copydb without -c switch, and I wish to recover data
out of it by parsing it out. I know another way might be that I can
create a temporary Database and load it with copy.in script, then export
again ...

Zhiliang
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 01:01 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.