{"id":61,"date":"2018-09-24T14:33:48","date_gmt":"2018-09-24T14:33:48","guid":{"rendered":"http:\/\/www.iam8up.com\/?p=61"},"modified":"2018-09-24T14:33:48","modified_gmt":"2018-09-24T14:33:48","slug":"extract-one-column-from-a-csv","status":"publish","type":"post","link":"https:\/\/www.iam8up.com\/?p=61","title":{"rendered":"Extract one column from a CSV"},"content":{"rendered":"<p>Assuming your CSV looks like this<\/p>\n<blockquote><p>&#8220;ID&#8221;,&#8221;DeviceName&#8221;,&#8221;IPAddress&#8221;,&#8221;LastStatusChange&#8221;<br \/>\n&#8220;211&#8221;,&#8221;customer name here&#8221;,&#8221;172.16.10.19&#8243;,&#8221;2018-08-1309:51:28&#8243;<br \/>\n&#8220;339&#8221;,&#8221;fue bah&#8221;,&#8221;10.13.0.1&#8243;,&#8221;2018-09-0619:28:30&#8243;<\/p><\/blockquote>\n<p>We can use Notepadd++ (or other tool) and some regex to extract the IP address.<\/p>\n<p>Find what:\u00a0^(.*?),(.*?),(.*?),(.*?)$<br \/>\nReplace with: $3<\/p>\n<p>Be sure to use regex if you&#8217;re on Windows\/Notepad++!\u00a0 This works with four &#8220;column&#8221; documents, to adjust it for more or less be sure to mirror the number of commas and use one &#8211; (.*?) &#8211; for each column.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Assuming your CSV looks like this &#8220;ID&#8221;,&#8221;DeviceName&#8221;,&#8221;IPAddress&#8221;,&#8221;LastStatusChange&#8221; &#8220;211&#8221;,&#8221;customer name here&#8221;,&#8221;172.16.10.19&#8243;,&#8221;2018-08-1309:51:28&#8243; &#8220;339&#8221;,&#8221;fue bah&#8221;,&#8221;10.13.0.1&#8243;,&#8221;2018-09-0619:28:30&#8243; We can use Notepadd++ (or other tool) and some regex to extract the IP address. Find what:\u00a0^(.*?),(.*?),(.*?),(.*?)$ Replace with: $3 Be sure to use regex if you&#8217;re on Windows\/Notepad++!\u00a0 This works with four &#8220;column&#8221; documents, to adjust it for more or less be &hellip; <a href=\"https:\/\/www.iam8up.com\/?p=61\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Extract one column from a CSV&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":2,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}