Hello Spiceworks,<\/p>\n
I have this object:<\/p>\n
$date = \"<p><strong>April 1</strong></p>\n <ul>\n <li>New Jersey has received an additional <strong>3,649 </strong>positive test results, bringing the total number of positive \ntest results to <strong>22,255</strong></li>\"\n\n<\/code><\/pre>\n
Advertisement
I strip it down:<\/p>\n
(((($date) -split \"<strong>\") -replace \"covid-19\", \"\") -replace \"\\D+\", \"\")\n\n<\/code><\/pre>\nmy result is this:<\/p>\n
1\n3649\n22255\n\n<\/code><\/pre>\nI want to strip the first line, 1, and the last line, 22255, and keep the second line 3649. Something that selects the second line. I am still new to PowerShell, this seems so basic…yet i cant figure it out.<\/p>","upvoteCount":4,"answerCount":3,"datePublished":"2020-04-25T18:10:41.000Z","author":{"@type":"Person","name":"spiceuser-m3g69","url":"https://community.spiceworks.com/u/spiceuser-m3g69"},"acceptedAnswer":{"@type":"Answer","text":"
like so?<\/p>\n
$date = \"<p><strong>April 1</strong></p>\n <ul>\n <li>New Jersey has received an additional <strong>3,649 </strong>positive test results, bringing the total number of positive \ntest results to <strong>22,255</strong></li>\"\n\n$info = (((($date) -split \"<strong>\") -replace \"covid-19\", \"\") -replace \"\\D+\", \"\")\n$info[2]\n<\/code><\/pre>\nIf you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n