this post was submitted on 29 Jun 2025
355 points (99.2% liked)

Science Memes

15753 readers
3852 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] wiase@discuss.online 33 points 2 weeks ago* (last edited 2 days ago) (3 children)

No, but seriously, half of my research time is wasted on renaming downloaded files. (Yeah, I know, there's reference management software but people use different ones, so sharing papers or storing them for easy access is still dependent on properly named files.)

[–] spiffmeister@aussie.zone 11 points 2 weeks ago (1 children)

Why aren't you just sending people a doi or a hyperlink if they want a paper? And if they have asked for a specific paper surely they can do the renaming?

[–] wiase@discuss.online 1 points 3 days ago

No, because we do collaborate on sharepoints.

[–] nialv7@lemmy.world 9 points 2 weeks ago (1 children)

This feels like it could be a legitimate use of LLM.

[–] wiase@discuss.online 1 points 3 days ago

Don't get me started on what is a legitimate use for LLM given the ethical and ecological implications.

[–] sga@lemmings.world 6 points 2 weeks ago (1 children)

I have a script which fetches bib entries for pdfs, and then renames it to my prefered format (names of author (no more than 2) - name of paper).

in case you are interested


#!/usr/bin/env sh

newnamefn(){
	bib="$(pdf2bib "$1")"
	name="$(echo "$bib" | grep "title = " | cut -d'{' -f 2 | cut -d'{' -f 1 )"
	authors=$(echo "$bib" | grep "author = " | cut -d'{' -f 2 | cut -d'{' -f 1  | sed -z 's/\ and\ /\n/g' | head -n 2 | tr '\n' ' ')
	echo "$authors-$name" | detox --inline
}

for i in "$@" ; do 
	newname="$(newnamefn "$i")" 
	mv "$i" "${i%/*}/$newname".pdf
done

detox --inline is just a utility which makes the file names shell friendly (removes special characters and spaces), but that is optional. Also, technically the newnamefn is what does all of the job, and below is just a loop to iterate on all files that are given as input like script file1 "file2" file3, where file2 had some special characters, so enclosed in "" quotes. you can also translate it to python, then you would not even require sed and grep (you can just get output in json-esque format). I have a small keybinding in my file manager, which renames all selected files, so I do not have to spend any amount of my mind

you can make it work in any os (maybe use some llm for it), you just have to install pdf2bib

[–] wiase@discuss.online 2 points 3 days ago (1 children)

Nice! Thank you! (Can't install it on my work computer though because ~reasons~ but will certainly try on my private laptop.)

[–] sga@lemmings.world 2 points 2 days ago

you can create a python virtual environment, and you do not even have to install python for that. you can install python in a user only mode, and then create a virtual environment (these can be made anywhere, so for example, your downloads or documents folder(assuming you are allowed to access these folders, you usually do)), script would have to be modefied a bit, but still doable. In case you need help for this, feel free to reply/message