# AWK scripting Be sure to also include detailed comments in each script! Part I
ID: 3866751 • Letter: #
Question
# AWK scripting
Be sure to also include detailed comments in each script!
Part I: Addressing the Subject
Consider the following file named rawaddresses:
Mike:James:314849866:mjames69@asu.edu:5059358554:NM:8830:Johnson:Rd:Albuquerque:87122
Ian:Wehe:989987412:iwehe@asu.edu:2025550126:CO:2001:Blake:St:Denver:80205
Kaleb:Lee:605497184:kalebll@mailinator.com:3035550103:CO:5986:Budweiser:Way:Alamosa:81101
Edith:Johnson:783333251:edithj@mailinator.com:6515550164:MN:14:5th:St:Minneapolis:55403
Jared:Peterson:325764011:jpeterson@asu.edu:4561238888:WA:54246:8th:Ave:Lacey:98513
Aaron:Nulk:124085733:anulk@asu.edu:2093865442:KS:1234:Manhattan:St:Riley:87512
Martha:Lyons:123456123:mtlyons166@asu.edu:5755595459:AZ:635:Elm:St:Mesa:85212
Evan:Turtle:983421567:eat@hotmail.com:8587754321:IA:3400:Island:Rd:Desmoines:50021
Sam:Whiz:745629754:samwhiz76@yahoo.com:6195323200:CA:215:CollegeGroveWay:Sandiego:9120
The data consists of:
firstName:lastName:StudentID:emailAddress:phoneNumber:stateCode:streetNumber:streetName:city:zipCode
Write an awk program, named lab6.1.awk, to process the data and store it in a file called lab6.1.out in the format below:
firstName lastName, phoneNumber
streetNumber streetName
city, stateCode zipCode
emailAddress
phoneNumber
For example, the entry:
Ian:Wehe:989987412:iwehe@asu.edu:2025550126:CO:2001:Blake:St:Denver:80205
Will become:
Ian Wehe, 989-98-7412
2001 Blake St
Denver, CO 80205
iwehe@asu.edu
(202) 555-0126
Explanation / Answer
NOTE: I have completed the code as per instructions. Please check and let me know if you face any issues. I will revert back within 24 hours.
Code:
http://pasted.co/5ed71ed0
Code output screenshot:
https://pasteboard.co/GEw3iGj.png
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.