How can I use grep to find a partial string match and return only a portion of that string to a new column in my existing data table?
For example, I have a column $remarks in dt:"FC3"
Some of the remarks say "blah blah blah 57 DAYS LATE blah blah"
Is there a statement I can use to grab the '57 DAYS LATE' part and put it in a new column? Of course, it is not always 57 days, sometimes its 145, sometimes just 8 - so the length of the string is dynamic.
per request: here is example/reproducable data (i think this is what you were asking for)
7548 1D10000 2016 2016 CAT 1 WAS SUBMITTED 9 DAYS LATE
3647 1D10001 2011 PENALTY PAID
3547 1D39949 2013 2013 CAT 1 WAS 57 DAYS LATE SUBMIT
here, the column containing the strings "2016 CAT 1 WAS SUBITTED 9 DAYS LATE", as well as the string "2013 CAT 1 WAS 57 DAYS LATE SUBMIT" in their respective rows are the strings I am referring to. What process would be best for me to be able to search for, grab, and place the "9 DAYS LATE" or the "57 DAYS LATE" strings in a new column?
The column name containing the string i want is FC4$remarks
Thank you and I hope this clarifies!