It should be a simple fix, but I can not wrap my head at this time.
There is a comma-delimited file named I I need to get user input about the last two areas and change them accordingly. Example: , Computer Org & amp; Programming, 3.0, N / A CSC2010, Introduction to Computer Science, 3.0, N / A CSC1010, Computer & amp; Application 3,0, N / A I get user input for 3 things: So far, I have tried to match the line which has a course number and the last two fields changed Used to be. I do not know how to modify the previous two areas by using SAL, so I am using this terrible disturbance and SAD: The issue is that I'm moving in here The numbers in the course title can be from 1 to 4 in the field so that Not only the first n fields can not simply print. I have tried to remove the last two areas and add new values for the status and grade but it is not working for me. Note: I have already checked to ensure that the user validates valid data Use a simple encoded script: And on the CMD-line, set three parameters, different parameters like curriculum, position and grade. In action: my_course that contains a list of some information about them.
CSC3210
course number ,
position (0 or 1) , and
Grade (A, B, C, N / A)
temporary = $ (awk -v status = $ status -v grade = $ grade 'BEGIN {FS = ","}; $ (NF) = "" $ (NF-1) = "" /' $ cNum '/ {printf $ 0 " "Status", "grade;} 'my_course) sed -i" s / csc $ cnum. * / $ Temp / g "my_course
BEGIN {FS = "," OFS = FS} $ 0 ~ course {$ (NF-1) = position $ NF = Grade} {print}
$ cat input CSC3210, computer ORG & amp; Programming, 3.0, N / A CSC2010, Introduction to Computer Science, 3.0, N / A CSC1010, Computer & amp; APPLICATIONS, 3.0, N / A $ AJK-vcourse = "CSC3210" -vstatus = "1" -Agread = "A" -f grade.com Input CSC 3210, Computer Org & amp; Programming, 3.1, a CSC-2010, Introduction to Computer Science, 3.0, N / A CSC 1010, Computer & amp; APPLICATIONS, 3.0, N / A $ AJK-vcourse = "CSC1010" -vstatus = "1" -Agread = "B" -F grade Input Input CSC 3210, Computer ORG & amp; Programming, 3.0, N / A CSC2010, Introduction to Computer Science, 3.0, N / A CSC1010, Computer & amp; APPLICATIONS, 3.1, b
No comments:
Post a Comment