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
  "[Errno 2] No such file or directory" (.py file) IbrahimBennani 12 490 Jun-12-2024, 03:29 PM
Last Post: snippsat
  file open "file not found error" shanoger 8 1,483 Dec-14-2023, 08:03 AM
Last Post: shanoger
  Need to replace a string with a file (HTML file) tester_V 1 899 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 1,093 Jul-17-2023, 10:15 PM
Last Post: Pedroski55
  File path by adding various variables Mishal0488 2 1,207 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 1,240 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,240 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  Script File Failure-Path Error? jerryf 13 3,759 Nov-30-2022, 09:58 AM
Last Post: jerryf
Photo Making Zip file of a file and Directory Nasir 2 1,116 Oct-07-2022, 02:01 PM
Last Post: Nasir
  Need Help: Convert .pcl file to .pdf file ManuRaval 6 2,694 Sep-13-2022, 01:31 PM
Last Post: ManuRaval

Forum Jump:

User Panel Messages

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