Last active
May 20, 2020 12:43
-
-
Save juanluisrto/66e2bf157ab32719210cdcac2327f3a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd, os, shutil | |
df = pd.read_excel("Free+English+textbooks.xlsx") | |
for cat in df["English Package Name"].unique(): | |
os.mkdir("download/" + cat) | |
for index, row in df.iterrows(): | |
category = row.loc["English Package Name"] | |
file_name = f"{row.loc['Book Title']}_{row.loc['Edition']}".replace('/','-').replace(':','-') | |
shutil.move(f"download/{file_name}.pdf", f"download/{category}/{file_name}.pdf") |
It seems you are having issues with f-string formatting. This was included in python 3.6.
Are you using python 3.6 or above?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! I tryed to use this script (OSX) but i got this error:
