#!/bin/bash # Read input file name from command line argument input_file=$1 # Set output file name output_file="${input_file%.*}.csv" # Remove spaces between words in each line and save as CSV sed 's/ //g' "${input_file}" | tr '\n' ',' > "${output_file}" echo "" >> "${output_file}" # Print success message echo "Output saved to ${output_file}"