My column headers will change every time I run my analyses, as they are indexed to the time period of each piece of data, and I need to set up a Column Rename Regex to remove the first portion of each column title, even though it’s different each time.
I have my initial output, then complete a pivot to compare two different time periods side-by-side
In this case the “2023_2+First” will be different each time as it’s tied to the date of the data. This is the piece I need to remove/replace. The “Neighborhood AVG Close Price” remains the same each iteration.
I need to remove and replace the “2023_2+First” and the next time I run it “2023_3…”, and into eventually “2024_3…” etc.
So I want to set up a Regex to remove and replace anything that shows up in the column header before “Neighborhood AVG Close Price”.
Hi,
For this you can use \d{4}_\d{1,2}\+First(.+) as regex and $1 as the replacement. This will yield *(Neighborhood AVG Closing Price). If you also want to remove the * and the parentheses, you can use this regex instead: \d{4}_\d{1,2}\+First\*\((.+)\).
Kind regards,
Alexander