strg = line.replace(';\n',';NODATA;\n')
This option replaces ";" with "Nodata" not the value before it .
Sorry, I misread your post.
It will not be pretty, but it can be done.
Use the split function to create a list of the elements in the row and then rewrite the row and replace that element (index 10) in the list with NODATA.
1 person found this helpful
I'd keep things simple
line = 'Actual;FY17;Dec;YTD;GOE;;12345;GO;12;E1;5687;'
newline = "%s;NODATA;" % line[:line.rfind(";")]
you can use rfind to get the position of the last occurrence
Just to verify with you experts and also suggest me if anyother logic I can think off .
I am trying to do an FDM smartreplace on HFM , the logic I took was to identify the last successfull load data file and change the Data value to "Nodata" and prepend to the current data file and this happens after AftExpDat.
As said getting the expected result , its clearing/Nodata the data for the orphan entities.
Suggest me if any other logic I can work through ?