Replace empty cells with text in a text string

5348
10
Jump to solution
05-31-2018 04:25 AM
TheodoreF
Frequent Contributor

I can't find the answer anywhere, but how can I replace cells in a string field that have no data at all in them, with text? I'm not looking to replace spaces.

The second row here in Claim_Spend_in_£ (which is a text tield), has no data at all in it. It is not a blank space, or a NULL. I want all blank entries to be replaced with the text "Unrecorded". But the code I used above does nothing... I've tried using "", " ", None and neither of those work. I've also tried .strip to strip the field of any spaces first before running replace. No difference.

How can I acheive this?

And for further help, how can I replace all <Null> entries in a DATE formatted field, with the date "11/11/1111"? (Essentially I can't have any null values, so any unrecorded dates have to be a made up filler of 11/11/1111...

I see there is no .replace function for non-string fields...

10 Replies
TheodoreF
Frequent Contributor

To answer the second part of my question relating to replacing all NULL values in a date field, with the made up date of '11/11/1111', this solution works well: