Let me suggest Perl, as this site is mostly about Perl.
I would assume most of the syntax you would use is found in your course material, but also in perlsyn. Personally, I would look at perlrun and use the "autosplit" parameter, together with push and print, and the if statement.
In reply to Re: switching two columns under conditions
by Corion
in thread switching two columns under conditions
by gghelpneeded
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |