Skip to content

Fix lists - Migrate from semicolon to comma as separator#139

Merged
koppor merged 4 commits into
JabRef:mainfrom
northword:to-comma
Sep 2, 2023
Merged

Fix lists - Migrate from semicolon to comma as separator#139
koppor merged 4 commits into
JabRef:mainfrom
northword:to-comma

Conversation

@northword

@northword northword commented Aug 18, 2023

Copy link
Copy Markdown
Contributor

Fixes #130

  • update all lists
  • update all scripts

@northword northword marked this pull request as ready for review August 19, 2023 03:16
@northword

Copy link
Copy Markdown
Contributor Author

@koppor , @Siedlerchr

Hi, thanks for your work, as issue #130 , I have completed csv migration from semicolon to comma with csv file and all scripts, please review the code. Thanks!

@koppor koppor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, wow, looks very awesome! Thank you for taking your time.

I have a small "nitpick" regarding the readability of the CSV files. Now all items are quoted. I find that more hard to read than before. What's your take on that?

Zhipu Xuebao;Zhipu Xuebao
Zhongguo Shengwu Huaxue Yu Fenzi Shengwu Xuebao;Zhongguo Shengwu Huaxue Yu Fenzi Shengwu Xuebao
Zhongguo Wuji Fenxi Huaxue;Zhongguo Wuji Fenxi Huaxue
"ACS Applied Materials & Interfaces","ACS Appl. Mater. Interfaces"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need " everywhere? Wouldn't it be possible to use enclsoing quotes only when needed?

@northword northword Aug 31, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, it's my preference, I'm used to making all the formatting consistent, and when there's a value that needs to have quotes added to it, I always want to make the other values consistent with that value. Not only in CSV documents, but also when I format js objects.
I don't think all quotes affect the readability of the data, it clearly tells the user that what is between each pair of quotes is continuous text.
If the JabRef team thinks that "use quotes only when necessary" is a better solution, I can change it over.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed internally and follow your flow!

data = list(csv_reader)

with open(output_file, 'w', newline='', encoding='utf-8') as outfile:
csv_writer = csv.writer(outfile, delimiter=',', quoting=csv.QUOTE_ALL)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, QUOTE_ALL should be replaced by something else

Comment thread .gitignore
# End of https://www.toptal.com/developers/gitignore/api/linux,windows,intellij+all,microsoftoffice,latex

# For repo
/*.csv No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? I think, this has to be removed - we do version csv files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ignore only affects csv files in the root directory of the repository, which are usually generated by script combining or processing, and in fact are not checked into the repository. journals/*.csv is not affected.

@koppor koppor merged commit 0273c51 into JabRef:main Sep 2, 2023
@koppor

koppor commented Sep 2, 2023

Copy link
Copy Markdown
Member

Needed to update the update scripts also to use " everywhere. Done at #145.

@northword northword deleted the to-comma branch September 2, 2023 13:42
Biblioteca di Bibliografia Italiana;Bibl. Bibliogr. Ital.
Biblioteca de la Ciencia Española;Bibl. Cienc. Esp.
Bibliothèque d'Histoire des Sciences;Bibl. Hist. Sci.
\cyr Biblioteka Matematika;Bibl. Mat.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what these escapings (\cyr) etc. mean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix lists - Migrate from semicolon to comma as separator

2 participants