Hello, I have the following dataset:
input str10 taxid str20 employer str10 degree number
"123" "google" "BS" 2000
"" "" "MS" 2000
"" "" "PHD" 1000
"456" "amazon" "BS" 1000
"" "" "MS" 1500
"" "" "PHD" 2100
"789" "EY" "BS" 200
"" "" "MS" 150
end
I want to fill out the taxid by copying the value in the current row to the next row if the next row is empty. If the next row is not empty, stop copying. The output I'd like to have is
input str10 taxid str20 employer str10 degree number
"123" "google" "BS" 2000
"123" "google" "MS" 2000
"123" "google" "PHD" 1000
"456" "amazon" "BS" 1000
"456" "amazon" "MS" 1500
"456" "amazon" "PHD" 2100
"789" "EY" "BS" 200
"789" "EY" "MS" 150
end
Thank you for your advice!
input str10 taxid str20 employer str10 degree number
"123" "google" "BS" 2000
"" "" "MS" 2000
"" "" "PHD" 1000
"456" "amazon" "BS" 1000
"" "" "MS" 1500
"" "" "PHD" 2100
"789" "EY" "BS" 200
"" "" "MS" 150
end
I want to fill out the taxid by copying the value in the current row to the next row if the next row is empty. If the next row is not empty, stop copying. The output I'd like to have is
input str10 taxid str20 employer str10 degree number
"123" "google" "BS" 2000
"123" "google" "MS" 2000
"123" "google" "PHD" 1000
"456" "amazon" "BS" 1000
"456" "amazon" "MS" 1500
"456" "amazon" "PHD" 2100
"789" "EY" "BS" 200
"789" "EY" "MS" 150
end
Thank you for your advice!
Comment