I have a very simple question .... I have a text file and have to replace only one field in the string.
123|Name|Subject|Read|Receipt
124|Name2|Subject2|Read|Receipt
125|Name3|Subject3|Read|Receipt
126|Name4|Subject4|Read|Receipt
I have to first match the first field ID (e.g. 125) and then replace the 'Read' with 'Unread' only for this line in the text file and save it.
any ideas as how to do it. I have tried a couple of methods but I am stuck with it.
Search and Replace (i.e. Regex) is not the question here, I am asking for how to re-write the file once the replacement has been made.
thanks in advance.
123|Name|Subject|Read|Receipt
124|Name2|Subject2|Read|Receipt
125|Name3|Subject3|Read|Receipt
126|Name4|Subject4|Read|Receipt
I have to first match the first field ID (e.g. 125) and then replace the 'Read' with 'Unread' only for this line in the text file and save it.
any ideas as how to do it. I have tried a couple of methods but I am stuck with it.
Search and Replace (i.e. Regex) is not the question here, I am asking for how to re-write the file once the replacement has been made.
thanks in advance.