Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEGIN{
- FS=",";
- first="";
- second="";
- line="";
- }
- {
- line=""
- for(c=1;c<=NF;++c) {
- if(c==i) {
- first=$c;
- }
- if(c==j) {
- second=$c;
- }
- }
- for(c=1;c<=NF;++c) {
- if(c!=i && c!=j)
- line=line$c;
- if(c==i)
- line=line second;
- if(c==j)
- line=line first;
- if(c!=NF)
- line=line";";
- }
- print line;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement