Quote:
Originally Posted by Nominal Animal
This should do the job, and also split each fact on a separate line. It does a bit more than you asked for, but I guess this is what I'd start with.
Code:
tr -s '\r\n' '\n\n' < infile | sed -e 's|[\t\v\f ]*=[\t\v\f ]*|=|g; s|[\t\v\f ][\t\v\f ]\+\([^\t\v\f =]\+\([\t\v\f ][^\t\v\f =]\+\)*=\)|\n\1|g' | sed -e 's|^[\t\v\f ]\+||; s|[\t\v\f ]\+$||; s|[\t\v\f ]\+)|)|g; s|[\t\v\f ][\t\v\f ]\+| |g' | awk '/^ID=/ { id=$0 ; print id ; next } /=/ && length(id) { print id "|" $0 }' >outfile
|
i ran this on my real file and got a zero byte output file, so there must be something in real file that causes no output. i ran this on the sample i provided (post #13) and it did have output, but not in the format needed (post #13).
and to remove whitespace around the "=" sign i use
Code:
sed 's/[[:space:]]*=[[:space:]]*/=/g'