Skip to content

Commit

Permalink
Merge pull request #19 from Pablo1990/main
Browse files Browse the repository at this point in the history
Batch processing of a directory
  • Loading branch information
ebranlard authored Nov 30, 2023
2 parents 39f9367 + 1c265f7 commit 2fd2045
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions batchProcessing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Check if the directory argument is provided
if [ $# -eq 0 ]; then
echo "Error: Directory argument is required."
exit 1
fi

# Check if the directory exists
if [ ! -d "$1" ]; then
echo "Error: Directory does not exist."
exit 1
fi

# Recursively find all files and execute the command on each file
find "$1" -type f -name "*.m" | while read file; do
python matlab2python.py "$file" -o "${file%.m}.py"
done

echo "Conversion completed."

0 comments on commit 2fd2045

Please sign in to comment.