#!/bin/bash

if [ $# -ne 2 ]; then
    echo "Usage: $0 input.txt output.txt"
    exit 1
fi

input="$1"
output="$2"

# Remove whitespace/newlines from input, then split into pairs
tr -d '[:space:]' < "$input" | fold -w 2 > "$output"

echo "Output written to $output"
