we would check whether the CODE field (5th Column) is spaces or not. If it's spaces, we will remove the record. If it is not, we will update the data from previous record till the code field (5th column). There may be multiple records with only code field(5th column) populated. We have to fill these up from the top record having data populated in the previous fields.
for ease of reference, I am providing below the Field length for each field:
I guess we have to use SPLICE to get the data from above to below fields. Before that we have to Group the data together based on the Blank fields & the row above the Blank fields that contains data for FIELD1 to FIELD4.