I am trying to write a Python script in Spyder to deal with several files at the same time.
Actual path is something like:
/TestCondition/TestDate-A1.txt
I want to control the TestCondition and TestDate only at the beginning.
FoldPath = TestCondition
FileName = TestDate
I want to do something like:
dfA1 = pd.read_csv(FoldPath&'/'Filename&'A1.txt'
dfA2 = pd.read_csv(FoldPath&'/'Filename&'A2.txt'
....
dfA12 = pd.read_csv(FoldPath&'/'Filename&'A12.txt'
#Code with Pandas and Numpy...
How do I concatenate the variable names FoldPath and FileName with the string "A1 to A12" specifically to call out a csv file ? I can't find the correct syntax.
Thanks, J-F
Edit Question solved. With the knowledge of "import os" and also "os.path.join", I can now find a bunch of examples to do what I intended to do. I know that this question has been asked several times, but with my limited knowledge of Python, and programming in general, I could not find the correct key words. Anyway, thanks again for your quick answers.
os.path.joinos.pathfunctions.