Use of -n to supress lines that do not match
sed ',Ap' RollList.csv
sed -n ',Ap' RollList.csv
Use of regex in sed
sed 's,A,ap' RollList.csv
sed -n 's,A,ap' RollList.csv
Strip the roll number
sed -n 's/....B...,//p' RollList.csv
sed -n 's.\*,//p' RollList.csv
Strip the name
sed -n 's/,.*//p' RollList.csv
Use of sed to edit a stream of lines
cat RollList.csv | sed -e 's/^.*,//g'
cat RollList.csv | sed -e 's/^.*,//g' > n.txt
cat RollList.csv | sed -e 's/,.*//g' > r.txt
Use of brackets to store fields
cat RollList.csv | sed -e 's/^\(.*\),\(.*\)$/\2,\1/g'
Changing case of fields
cat RollList.csv | sed -e 's/^\(.*\),\(.*\)$/\2,\L\1/g'
cat RollList.csv | sed -e 's/^\(.*\),\(.*\)$/\2,\L\[email protected]/g'