{"id":584,"date":"2008-08-08T02:40:34","date_gmt":"2008-08-08T10:40:34","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/2008\/08\/08\/new-primaltoys-object-for-easier-csv-handling\/"},"modified":"2008-08-13T14:01:09","modified_gmt":"2008-08-13T22:01:09","slug":"new-primaltoys-object-for-easier-csv-handling","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2008\/08\/08\/new-primaltoys-object-for-easier-csv-handling\/","title":{"rendered":"New PrimalToys object for easier CSV handling"},"content":{"rendered":"<p>With service build 569 of PrimalScript 2007 we added a COM object that makes it easier to deal with CSV (comma separated values) data and\/or files.<\/p>\n<p>While browsing through posts at ScriptingAnswers.com and some of Microsoft&#8217;s scripting related newsgroups I couldn&#8217;t help but notice that questions regarding CSV keep coming up.<\/p>\n<p>I mentioned this to one of our engineers, Stephen Poon, and he created this object that can edit and display CSV files really easily.<\/p>\n<p>The following script is a PowerShell sample, a VBScript sample is included with PrimalScript 2007 (any edition) and the free PrimalToys download at our <a href=\"http:\/\/www.primalscript.com\/Free_Tools\/index.asp\" target=\"_blank\">Free Tools Site<\/a><\/p>\n<p>$CSVEdit = New-Object -comObject &#8220;SAPIEN.CSVEditor&#8221;<br \/>\n$CSVEdit.FirstRowColumnNames = $True<br \/>\n$CSVEdit.DataStartRow = 1<br \/>\n$CSVEdit.ReadOnly = $True<br \/>\n$CSVEdit.Title = &#8220;Current Processes Summary&#8221;<br \/>\n$CSVEdit.Label=&#8221;Processes:&#8221; #Text Label for the Grid<\/p>\n<p>get-process | Export-Csv &#8220;C:\\Temp\\process.csv&#8221;<br \/>\n$CSVEdit.FileName = &#8220;C:\\Temp\\process.csv&#8221;<br \/>\n$CSVEdit.LoadFile()<br \/>\n$CSVEdit.ShowDialog()<\/p>\n<p>Running this will produce this dialog:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/08\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/08\/image-thumb.png\" border=\"0\" alt=\"image\" width=\"244\" height=\"216\" \/><\/a><\/p>\n<p>The object includes a number of methods to insert, remove, extract columns rows or fields with or without displaying the UI.<\/p>\n<p>Check it out and head over to our Free Tools forum at<br \/>\n<a title=\"http:\/\/support.sapien.com\/forum\/forum_topics.asp?FID=10\" href=\"http:\/\/support.sapien.com\/forum\/forum_topics.asp?FID=10\">http:\/\/support.sapien.com\/forum\/forum_topics.asp?FID=10<\/a><br \/>\nand let us know what you think and if\u00a0 there is anything we should add.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With service build 569 of PrimalScript 2007 we added a COM object that makes it easier to deal with CSV (comma separated values) data and\/or files. While browsing through posts at ScriptingAnswers.com and some of Microsoft&#8217;s scripting related newsgroups I couldn&#8217;t help but notice that questions regarding CSV keep coming up. I mentioned this to [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[21,24,25],"tags":[28,37,273,191,57,996],"class_list":["post-584","post","type-post","status-publish","format-standard","hentry","category-software-news","category-vbscript","category-windows-powershell","tag-powershell","tag-primalscript","tag-primaltoys","tag-sapien","tag-scripting","tag-vbscript"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=584"}],"version-history":[{"count":3,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/584\/revisions"}],"predecessor-version":[{"id":610,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/584\/revisions\/610"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}