I have setup the docker container to run the model evaluation.
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Here's the modified command that skips existing files and simplifies the output filename:
1 2 3 4 5 6 7 8 | find . -name "*.pdf" -exec sh -c ' for f do outfile="txt/$(basename "${f%%.pdf}").txt" if [ ! -f "$outfile" ]; then python3 process.py "$f" "$outfile" fi done ' sh {} + |
1 | mkdir -p txt |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/bin/bash # Create the txt directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' for f do outfile="txt/$(basename "${f%%.pdf}").txt" if [ ! -f "$outfile" ]; then python3 process.py "$f" "$outfile" fi done ' sh {} + |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/bin/bash # Create the txt directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' for f do outfile="txt/$(basename "${f%%.pdf}").txt" if [ ! -f "$outfile" ]; then python3 process.py "$f" "$outfile" fi done ' sh {} + |
final: True Resulting in output: True
I have setup the docker container to run the model evaluation.
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Here's the modified command that will skip existing files and clean up the output filename:
1 2 3 4 5 6 | find . -name "*.pdf" -exec sh -c ' out_file="txt/$(basename "${1%.*}").txt" if [ ! -f "$out_file" ]; then python3 process.py "$1" "$out_file" fi ' sh {} \; |
1 | mkdir -p txt |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 | #!/bin/bash # Create txt directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' out_file="txt/$(basename "${1%.*}").txt" if [ ! -f "$out_file" ]; then python3 process.py "$1" "$out_file" fi ' sh {} \; |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 | #!/bin/bash # Create txt directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' out_file="txt/$(basename "${1%.*}").txt" if [ ! -f "$out_file" ]; then python3 process.py "$1" "$out_file" fi ' sh {} \; |
final: True Resulting in output: True
I have setup the docker container to run the model evaluation.
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Here's the modified command that will skip existing files and fix the output filename extension:
1 2 3 4 5 6 | find . -name "*.pdf" -exec sh -c ' out="txt/$(basename "${1%.*}").txt" if [ ! -f "$out" ]; then python3 process.py "$1" "$out" fi ' sh {} \; |
1 | mkdir -p txt |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 | #!/bin/bash # Create txt directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' out="txt/$(basename "${1%.*}").txt" if [ ! -f "$out" ]; then python3 process.py "$1" "$out" fi ' sh {} \; |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 | #!/bin/bash # Create txt directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' out="txt/$(basename "${1%.*}").txt" if [ ! -f "$out" ]; then python3 process.py "$1" "$out" fi ' sh {} \; |
final: True Resulting in output: True
I have setup the docker container to run the model evaluation.
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Here's the modified command that will skip existing files and clean up the output filename:
1 2 3 4 5 6 7 8 | find . -name "*.pdf" -exec sh -c ' for f do out="txt/$(basename "${f%.pdf}").txt" if [ ! -f "$out" ]; then python3 process.py "$f" "$out" fi done ' sh {} + |
1 | mkdir -p txt |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/bin/bash # Create the output directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' for f do out="txt/$(basename "${f%.pdf}").txt" if [ ! -f "$out" ]; then python3 process.py "$f" "$out" fi done ' sh {} + |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/bin/bash # Create the output directory if it doesn't exist mkdir -p txt # Find and process PDF files find . -name "*.pdf" -exec sh -c ' for f do out="txt/$(basename "${f%.pdf}").txt" if [ ! -f "$out" ]; then python3 process.py "$f" "$out" fi done ' sh {} + |
final: True Resulting in output: True
I have setup the docker container to run the model evaluation.
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Here's the modified command that will skip existing files and use .txt instead of .pdf.txt:
1 2 3 4 5 6 7 8 9 10 | find . -name "*.pdf" -exec sh -c ' for pdf; do txt="${pdf%.pdf}.txt" txt="txt/${txt#./}" if [ ! -f "$txt" ]; then mkdir -p "$(dirname "$txt")" python3 process.py "$pdf" "$txt" fi done ' sh {} + |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 | find . -name "*.pdf" -exec sh -c ' for pdf; do txt="${pdf%.pdf}.txt" txt="txt/${txt#./}" if [ ! -f "$txt" ]; then mkdir -p "$(dirname "$txt")" python3 process.py "$pdf" "$txt" fi done ' sh {} + |
Running the following program:
1 2 3 4 5 6 7 8 9 10 | find . -name "*.pdf" -exec sh -c ' for pdf; do txt="${pdf%.pdf}.txt" txt="txt/${txt#./}" if [ ! -f "$txt" ]; then mkdir -p "$(dirname "$txt")" python3 process.py "$pdf" "$txt" fi done ' sh {} + |
final: True Resulting in output: True