Project on automating some very boring tasks... Can we save Rodericus?
- Install Docker;
- Verify you can access to a shell ( PowerShell on Windows).
Please, open your shell (for example, to open the PowerShell perform a right click on the windows icon and select the PowerShell) and type the following command (you can copy-paste it) (most of the commands are in Italian... sorry international guys!):
docker run -t --rm ghcr.io/robin-castellani/digital-humanities/digital-humanities:0.0.2
The shell will show you what is happening, read carefully its output!
So, here you can use commands
like sostituisci
to do something.
When you don't know what a command do, type it along with --help
;
here is an example (the copy-paste is still valid):
docker run -t --rm ghcr.io/robin-castellani/digital-humanities/digital-humanities:0.0.2 sostituisci --help
The help output will tell you what the command does and which options
it needs. In this case, sostituisci
perform some substitutions given
a .pdf
file and a .csv
file containing the substitutions; its
output is saved into a .txt
file. An option is --file-pdf
: you need
to tell which .pdf
file you want to read! Indeed, you have to type its
path. Look at this example (my helloworld.pdf
file is located in
C:\Users\VForVendetta\Desktop\helloworld.pdf
):
docker run -t --rm ghcr.io/robin-castellani/digital-humanities/digital-humanities:0.0.2 sostituisci --file-pdf "C:\Users\VForVendetta\Desktop\helloworld.pdf"
And so on...
sostituisci
- Create a folder and put your original
.pdf
file inside; - With a text editor, create a
.csv
file like this one:and put it in that folder;old_string|new_string old_string2|new_string2
- Open a shell;
- Use the command
cd
(that is, Change Directory) to move to the folder with the.pdf
and.csv
file; for example, if your files are inC:\Users\VForVendetta\Desktop
, type in the shellcd "C:\Users\VForVendetta\Desktop"
; - Type in the shell
of course, replace
sudo docker run -t --rm ghcr.io/robin-castellani/digital-humanities/digital-humanities:0.0.2 \ sostituisci \ --file-pdf <file-pdf.pdf> \ --file-sostituzioni <file-substitutions.csv>
<file-pdf.pdf>
with the actual name of your.pdf
file (the same with<file-substitutions.csv>
); - Wait and the look at the result in the
result.txt
file.
- Create a folder and put your original