Python Forum
list the files using query in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list the files using query in python
#1
Can you let me know how to list the files using the query output in python.

Output:
Input Files In Unix Directory : /DDD_Ext/input/ DDD_SL_NE_WAT_FCT_H001_QUAD_BD_20230225.csv DDD_SL_NE_WAT_FCT_H002_QUAD_BD_20230225.csv DDD_SL_NE_WAT_FCT_H003_QUAD_BD_20230225.csv DDD_SL_NE_WAT_FCT_H004_QUAD_BD_20230225.csv
SELECT
	   distinct(filecode),
	   delimiter,
	   a.country,
	   a.catcode,
	   a.client,
		hierarchynum,
		 notify
	FROM 
	   ddd_mail_addresses a 
	              JOIN ddd_data_types b ON a.categorycode = b.categorycode and a.client = b.client and a.country = b.country
				  JOIN ddd_conversion c ON a.categorycode = c.categorycode and a.client = c.client and a.country = c.country
				  JOIN ddd_hierarchy d ON a.categorycode = d.categorycode and a.client = d.client and a.country = d.country
				  where a.client='NE' and a.categorycode='WAT'  and a.country='SL'


Output :

Output:
Filecode Delimiter Country categorycode Client hierarchynum Email "QUAD" "|" "SL" "WAT" "NE" 1 "[email protected]" "QUAD" "|" "SL" "WAT" "NE" 2 "[email protected]" "QUAD" "|" "SL" "WAT" "NE" 3 "[email protected]" "QUAD" "|" "SL" "WAT" "NE" 4 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 1 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 2 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 3 "[email protected]" "WEEK" "|" "SL" "WAT" "NE" 4 "[email protected]"
Using Query need to list the files.
DDD_$country_$client_$categorycode_FCT_H00$hierarchynum_$filecode_BD_20230225.csv
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Need help for a python script to extract information from a list of files lephunghien 6 1,111 Jun-12-2023, 05:40 PM
Last Post: snippsat
  python sql query single quote in a string mg24 1 1,083 Nov-18-2022, 08:01 PM
Last Post: deanhystad
  "SUMIF" type query in Python (help required) BlainEillimatta 0 859 Oct-06-2022, 09:08 AM
Last Post: BlainEillimatta
  How to download a list of files from FTP? schnarkle 0 1,017 Jun-21-2022, 10:35 PM
Last Post: schnarkle
  MSSQL query not working in Python kat35601 0 926 Apr-12-2022, 06:44 PM
Last Post: kat35601
  Error using mariadb select query with form in python? shams 2 2,024 Jul-29-2021, 12:30 PM
Last Post: shams
  get all the files in the path in a list? korenron 23 7,137 Jul-19-2021, 07:44 AM
Last Post: korenron
  Put all files in a directory into list. How? Denial 2 2,149 Sep-18-2020, 10:05 PM
Last Post: Larz60+
  Python - List from csv files Wscwt011 1 1,852 Mar-18-2020, 06:22 PM
Last Post: alpho
  Python mysql query help please tduckman 4 4,331 Mar-13-2020, 03:42 PM
Last Post: Marbelous

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020