Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabella29 authored May 22, 2024
1 parent db77132 commit 4b7cad0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions AuthorAffiliationListGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def add_text(paragraph, text):
# Function to save the author list to a Word document, with ordered superscripts
def save_author_list_to_word(file_path, output_doc_path):
# Load the Excel spreadsheet
df = pd.read_excel(file_path)
df = pd.read_csv(file_path)

# Create a new Document
doc = Document()
Expand Down Expand Up @@ -44,7 +44,7 @@ def save_author_list_to_word(file_path, output_doc_path):
author_affiliations = []

# Process each possible affiliation column
for aff_col in ['Affiliation 1 name', 'Affiliation 2 name', 'Affiliation 3 name', 'Affiliation 4 name']:
for aff_col in ['Affiliation1', 'Affiliation2', 'Affiliation3', 'Affiliation4']:
affiliation = row.get(aff_col)
if pd.notna(affiliation):
if affiliation not in affiliations:
Expand Down Expand Up @@ -72,6 +72,6 @@ def save_author_list_to_word(file_path, output_doc_path):


# Specify the path to your Excel file and the output .docx file
file_path = r"C:\Users\dlabe\Downloads\melba authors for chatgpt.xlsx"
output_doc_path = r"C:\Users\dlabe\Downloads\Author_List_and_Affiliations.docx"
file_path = r"C:\Users\dlabe\Downloads\Meningioma authors csv.csv"
output_doc_path = r"C:\Users\dlabe\Downloads\Author_List_and_Affiliations arXiv.docx"
save_author_list_to_word(file_path, output_doc_path)

0 comments on commit 4b7cad0

Please sign in to comment.