# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/.*\|\*(Task 1)\*\|(.*)\|(.*)\|(.*)\|(.*)\|.*\|\*(Task 2)\*\|(.*)\|(.*)\|(.*)\|(.*)\|.*\|\*(Task 3)\*\|(.*)\|(.*)\|(.*)\|(.*)\|.*\|\*(Task 4)\*\|(.*)\|(.*)\|(.*)\|(.*)\|/{"ACTION":[{"TITLE":"$1","DUE DATE":"$2","DONE ON":"$3","NOTE":"$5"},{"TITLE":"$6","DUE DATE":"$7","DONE ON":"$8","NOTE":"$10"},{"TITLE":"$11","DUE DATE":"$12","DONE ON":"$13","NOTE":"$15"},{"TITLE":"$16","DUE DATE":"$17","DONE ON":"$8","NOTE":"$20"}]}/gs;t' <<< "|| ||Du Date||Done on||OK/NOK||Remarks||
|*Task 1*| | | | |
|*Task 2*| | | | |
|*Task 3*| | | | |
|*Task 4*| 15/03/23| | | See document X|"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html