0

I have a html main.txt file, I need help to split it in two parts. headpart.txt and bodypart.txt.

Below is my html main.txt text file - Original

<p class=\"auto-cursor-target\"><br /></p><table><tbody><tr><th><p>Name</p></th><th><p>Creation Date</p></th><th><p>ID</p></th><th><p>Comments</p></th></tr><tr><td><p>Ubuntu-18.04</p></td><td><p>Thu Sep 15 12:20:42 UTC 2022</p></td><td><p>12345</p></td><td><p>this_is_a_custom_comment</p></td></tr><tr><td><p>Ubuntu-18.04-16437838</p></td><td><p>Thu Sep 15 12:40:06 UTC 2022</p></td><td><p>56789</p></td><td><p>custom_comment</p></td></tr><tr><td><p>Ubuntu-18.04-2343</p></td><td><p>Thu Sep 15 13:03:04 UTC 2022</p></td><td><p>9876</p></td><td><p>custom_comment</p></td></tr></tbody></table><p class=\"auto-cursor-target\"><br /></p>

After split headpart.txt -

<p class=\"auto-cursor-target\"><br /></p><table><tbody><tr><th><p>Name</p></th><th><p>Creation Date</p></th><th><p>ID</p></th><th><p>Comments</p></th></tr>

Part 2 - bodypart.txt

<tr><td><p>Ubuntu-18.04</p></td><td><p>Thu Sep 15 12:20:42 UTC 2022</p></td><td><p>12345</p></td><td><p>this_is_a_custom_comment</p></td></tr><tr><td><p>Ubuntu-18.04-16437838</p></td><td><p>Thu Sep 15 12:40:06 UTC 2022</p></td><td><p>56789</p></td><td><p>custom_comment</p></td></tr><tr><td><p>Ubuntu-18.04-2343</p></td><td><p>Thu Sep 15 13:03:04 UTC 2022</p></td><td><p>9876</p></td><td><p>custom_comment</p></td></tr></tbody></table><p class=\"auto-cursor-target\"><br /></p>

======== I need help to split the main.txt to headpart.txt and bodypart.txt using shell script

Goural
  • 25
  • 1
  • 4

0 Answers0