Wow, of all my "first posts" since I started using the internet in 2000, this must be the one with the largest number of helpful replies in a single day. Glad to have found such a lively community!
All replies had some useful suggestions. Just for reference: In bash I would have written something like this, which of course has horrible performance, but is very close to pseudocode and therefore hard to get wrong. Some of the solutions posted above are just as readable, but faster and more extensible. Thanks a lot everyone, I couldn't figure that out myself.
for i in {1..7};do if (( $(cut -d '&' -f $i query.txt|uniq|wc -l) != 1 ));then f="$f,$i";fi;done;cut -d '&' -f "${f#,}" query.txtIn reply to Re: How could I simplify this redundant-column-removing code?
by rubystallion
in thread How could I simplify this redundant-column-removing code?
by rubystallion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |