Python Forum
How to get the file path and full file name
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get the file path and full file name
#8
Hi,

In a given directory there will always exist only one file contains the partial name"config_file", and I want to match which file name contains partial file name "config_file" and grab that full name of the file. Suppose,
in a given directory:

"D:\mainfolder"
maybe there are

"initial.csv"
"final.csv"
"config_file_data.csv"
"data.csv"

out of all CSV files, the file contains "config_file" is "config_file_data.csv", and I want to report this file name. Actually, periodically the files are updated, and but always there will be one file contain the name "config_file", and that I want to catch.
Reply


Messages In This Thread
How to the file location - by SriMekala - May-16-2019, 01:08 PM
Find a full file name from a partial filename in a given directory - by SriMekala - May-19-2019, 01:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write variable in a python file then import it in another python file? tatahuft 4 970 Jan-01-2025, 12:18 AM
Last Post: Skaperen
  JSON File - extract only the data in a nested array for CSV file shwfgd 2 1,093 Aug-26-2024, 10:14 PM
Last Post: shwfgd
  FileNotFoundError: [Errno 2] No such file or directory although the file exists Arnibandyo 0 1,015 Aug-12-2024, 09:11 AM
Last Post: Arnibandyo
  import a function from another file using relative path paul18fr 6 3,153 Aug-01-2024, 06:40 AM
Last Post: paul18fr
  "[Errno 2] No such file or directory" (.py file) IbrahimBennani 13 6,543 Jun-17-2024, 12:26 AM
Last Post: AdamHensley
  file open "file not found error" shanoger 8 8,075 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Need to replace a string with a file (HTML file) tester_V 1 1,958 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  How can I change the uuid name of a file to his original file? MaddoxMB 2 2,188 Jul-17-2023, 10:15 PM
Last Post: Pedroski55
  File path by adding various variables Mishal0488 2 3,997 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 2,133 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone

Forum Jump:

User Panel Messages

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