#!/usr/local/bin/gawk -f BEGIN{ FS="/" SEP=";" } ($0){ gsub(SEP, ", ") gsub("\\[.*\\]", "") gsub("[\t ]+", " ") printf("%s%s%s%s%s%s\n", $1, SEP, $3, SEP, $2, SEP) }