Last active
December 16, 2015 21:09
-
-
Save Aricg/5497208 to your computer and use it in GitHub Desktop.
Personal reference next time I use awk for other than print $x field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Gondrol | |
| 2321 | |
| 56 | |
| 58 | |
| 45 | |
| RinRao | |
| 2122 | |
| 38 | |
| 37 | |
| 65 | |
| Edwin | |
| 2537 | |
| 78 | |
| 67 | |
| 45 | |
| Dayan | |
| 2415 | |
| 30 | |
| 47 | |
| 20 | |
| Jones | |
| 2143 | |
| 78 | |
| 84 | |
| 77 | |
| root@aricdebian6:~/Gitted# awk '{FS="\n"; RS="\n\n"; }NR=="6"{ print $0 "\n""fields:",NF,"record:",NR }NR=="5"{ print $1,$2,$3 "\n""fields:",NF,"record:",NR }' Student.txt | |
| Dayan 2415 30 | |
| fields: 5 record: 5 | |
| Jones | |
| 2143 | |
| 78 | |
| 84 | |
| 77 | |
| fields: 5 record: 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment