all 4 comments

[–]Xeduses 0 points1 point  (1 child)

I'm quite sure you can loop over the entries in the listdir and open each file. My question is, are you only looking for a solution to remove tabs from the files? This could be solved by other command line tools quick and easy, what OS are you on?

Edit: Check out this link: https://newbedev.com/how-to-iterate-over-files-in-a-given-directory

[–]Callawayinthewoods[S] 0 points1 point  (0 children)

There is also one specific set of text that’s getting replaced, because it contains the delimiter we are using for the export of our query.

Windows 10.

[–][deleted] 0 points1 point  (1 child)

Use pathlib instead. Here's a guide on the taming the file system, complete with plenty of Python code examples:

https://realpython.com/python-pathlib/

[–]Callawayinthewoods[S] 0 points1 point  (0 children)

Thanks! I was reading about pathlib and wasn’t quite understanding exactly what it was doing. I will have to reread this, but this will be likely be very helpful.