perl -i.bak -pe "BEGIN { binmode STDOUT } s/(?=\[)/\r\n/g" file