benchmark_mps/find_non_planar/find_non_planar_rome.bash

35 lines
953 B
Bash
Raw Normal View History

#!/bin/bash
FILE_LIST=$1
echo "$FILE_LIST"
# Check if file_list.txt exists
if [ ! -f $FILE_LIST ]; then
echo "input file not found!"
exit 1
fi
INPUT_PATH=/home/richard/Projects/06_research/maximum_planar_subgraph/benchmark_data/graph_datasets/rome/gml/
# Read file paths from file_list.txt
while IFS= read -r INPUT_FILE; do
# Extract filename stem
filename=$(basename -- "$INPUT_FILE")
filename_stem="${filename%.*}"
# Modify output path
OUTPUT_PATH=/home/richard/Projects/06_research/maximum_planar_subgraph/benchmark_data/graph_datasets/rome/gml_non_planar/
# Run your program and capture its output
output=$(./ogdf_test_planar "$INPUT_PATH$INPUT_FILE")
echo "$filename_stem"
# Check the output and perform actions accordingly
if [ "$output" -eq 0 ]; then
# it is not planar, copy to folder
cp "$INPUT_PATH$INPUT_FILE" "$OUTPUT_PATH$INPUT_FILE"
fi
done < $FILE_LIST