Q:

Copy CSV field to next row (same column) if blank - Bash (preferably)

Basically (said slightly tongue-in-cheek) I have a csv file in a format like this:
"ID","Name","Phone Number"
"00001","Ricky Stallman","07771111111"
"00003","Harrison Ford","07701010101"
"00003","Harrison Ford",""
"00008","Bob Geldof","07712121212"

Where the 'Harrison Ford' entry appears again in my csv there's no number next to it (it's just the way the data is annoyingly presented to me). I need the csv to read like this (i.e with the number from the row above to be copied into the field below):
"ID","Name","Phone Number"
"00001","Ricky Stallman","07771111111"
"00003","Harrison Ford","07701010101"
"00003","Harrison Ford","07701010101"
"00008","Bob Geldof","07712121212"

Preferably in Bash if anyone has a suggestion?

A:

Try this:
awk -F',' '$3!~/""/{nbr=$3} {print $1","$2","nbr}' file

If the third column is "" then use the last valid value.

