Skip to content

Commit

Permalink
updated task3.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
KKGanguly committed Oct 23, 2024
1 parent e29d029 commit 4c28a9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion task3.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sed -i 's/\r$//' titanic.csv & gawk -v FPAT="[^,\"]*|\"([^\"]|\"\")*\"" '$3==2 && $12=="S" { print $0}' titanic.csv | sed 's/female/F/g; s/male/M/g' | gawk -v FPAT="[^,\"]*|\"([^\"]|\"\")*\"" '$6 != "" {sum += $6;count++} END {print sum/count}'
sed -i 's/\r$//' titanic.csv & gawk -v FPAT="[^,\"]*|\"([^\"]|\"\")*\"" '$3==2 && $12=="S" { print $0}' titanic.csv | sed 's/female/F/g; s/male/M/g' | gawk -v FPAT="[^,\"]*|\"([^\"]|\"\")*\"" '{print $0} $6 != "" {sum += $6;count++} END {print "The result is " sum/count}'

0 comments on commit 4c28a9d

Please sign in to comment.