How to avoid pre-moderation of my comments?
Is it possible to import .txt files in PostgreySQL
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > PostgreSQL database development > Is it possible to import .txt files in PostgreySQL 1 October 2002 22:08:29

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Is it possible to import .txt files in PostgreySQL

Murali Mohan Kasetty 1 October 2002 22:08:29
 Hi All,

Is it possible to import data from .txt files into PostgreySQL
7.1.3. If so , How do I do it?

Any help would be greatly appreciated.


Thanks in advance,
Murali



-------------------­--------(end of broadcast)---------­------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresq­l.org so that your
message can get through to the mailing list cleanly
Add comment
Martijn van Oosterhout 1 October 2002 15:16:51 permanent link ]
 On Tue, Oct 01, 2002 at 05:40:42PM +0530, Murali Mohan Kasetty wrote:> Hi All,>
Is it possible to import data from .txt files into PostgreySQL> 7.1.3. If so , How do I do it?>
Any help would be greatly appreciated.

\copy in psql can copy delimited files. There is a similar facility using
the pq library.

--
Martijn van Oosterhout <kleptog@svana.org>­ http://svana.org/kl­eptog/> There are 10 kinds of people in the world, those that can do binary> arithmetic and those that can't.

-------------------­--------(end of broadcast)---------­------------------
TIP 6: Have you searched our list archives?

http://archives.pos­tgresql.org

Add comment
Jeff Eckermann 1 October 2002 22:02:45 permanent link ]
 
--- Martijn van Oosterhout <kleptog@svana.org>­ wrote:> On Tue, Oct 01, 2002 at 05:40:42PM +0530, Murali> Mohan Kasetty wrote:> > Hi All,> >
Is it possible to import data from .txt files> into PostgreySQL> > 7.1.3. If so , How do I do it?> >
Any help would be greatly appreciated.>
\copy in psql can copy delimited files. There is a> similar facility using> the pq library.>
One small point: if your .txt file originated on a
Windows machine, the lines will be terminated by
carriage return/line feed pairs. Since unix-type
operating systems only recognize the line feed as a
line terminator, the carriage return would be included
in your data. This is almost certainly not what you
want. You would need to delete those carriage returns
before importing your data. Something like:
perl -pi -e 's/\r$//' <datafile>

___________________­____________________­___________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.co­m

-------------------­--------(end of broadcast)---------­------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHer­e" to majordomo@postgresq­l.org)

Add comment
Walt Weaver 1 October 2002 22:08:29 permanent link ]
 Or use dos2unix...

--Walt

-----Original Message-----
From: Jeff Eckermann [mailto:jeff_eckermann@yahoo.com]
Sent: Tuesday, October 01, 2002 1:03 PM
To: Martijn van Oosterhout; Murali Mohan Kasetty
Cc: pgsql-general@postg­resql.org
Subject: Re: [GENERAL] Is it possible to import .txt files in
PostgreySQL



--- Martijn van Oosterhout <kleptog@svana.org>­ wrote:> On Tue, Oct 01, 2002 at 05:40:42PM +0530, Murali> Mohan Kasetty wrote:> > Hi All,> >
Is it possible to import data from .txt files> into PostgreySQL> > 7.1.3. If so , How do I do it?> >
Any help would be greatly appreciated.>
\copy in psql can copy delimited files. There is a> similar facility using> the pq library.>
One small point: if your .txt file originated on a
Windows machine, the lines will be terminated by
carriage return/line feed pairs. Since unix-type
operating systems only recognize the line feed as a
line terminator, the carriage return would be included
in your data. This is almost certainly not what you
want. You would need to delete those carriage returns
before importing your data. Something like:
perl -pi -e 's/\r$//' <datafile>

___________________­____________________­___________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.co­m

-------------------­--------(end of broadcast)---------­------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHer­e" to majordomo@postgresq­l.org)

-------------------­--------(end of broadcast)---------­------------------
TIP 4: Don't 'kill -9' the postmaster

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > PostgreSQL database development > Is it possible to import .txt files in PostgreySQL 1 October 2002 22:08:29

see also:
removing duplicate validation messages…
Console interface
Struts form tag attribute…
пройди тесты:
see also:
Trifle Matters
Change Means...
Let's Join the Army

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .