PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 25th, 2012, 01:15 PM
Neel9102 Neel9102 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 1 Neel9102 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 19 sec
Reputation Power: 0
How to list all the file names (of a folder) to a postgre table?

In a folder I have thousands of CSV file and those are named like “TUW_gp0246878” (where the “TUW_gp” part is common but the last 7 digits are different for each csv file.) and inside every csv file there are two column (year, name) and filled with data (like 10 t0 15 cases/rows). And I have a postgre table which has 3 column (id, year, name)
Now what I want is, I need a script which will automatically allow me to:
1. Fill the postgre table id field with the last 7 digit from the csv file’s name (ex: “0246878” from “TUW_gp0246878” file name) and year (from that specific csv file) to year (postgre table). As in csv there are so many rows. In that case, in every row (in the post gre table) 7 digits Id will be common.
2. As in that folder there are too many csv files, the above operation will be done for each csv file automatically and put into that postgre table.
Hope I was able to explain what I want.  can anyone help?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > How to list all the file names (of a folder) to a postgre table?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap