Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
All
I need to check if a parquet file exists before running some code. Is there a way of checking if a file exists in a notebook. I just need it to return a true or false.
Thanks
Neil
Solved! Go to Solution.
Thanks for this, but they didn't work as I needed to use wildcards in my pathway. However this worked
Import glob
search_pattern = '/root_folder/*/*/*/target_file.txt'
files = glob.glob(search_pattern)
if files:
print(f"File found: {files[0]}")
else:
print("File not found.")
Thanks for this, but they didn't work as I needed to use wildcards in my pathway. However this worked
Import glob
search_pattern = '/root_folder/*/*/*/target_file.txt'
files = glob.glob(search_pattern)
if files:
print(f"File found: {files[0]}")
else:
print("File not found.")
if you are using python, you could read this website.
https://www.freecodecamp.org/news/how-to-check-if-a-file-exists-in-python/
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
2 |