LEARN with scripting TRAINING CREATE with SCRIPTING TOOLS SHARE in a COMMUNITY BUY Scripting Products

SAPIEN Solutions

SAPIEN homepage
SAPIEN Software
PrimalScript script editor+ide
PrimalScope script debugger
Free Tools script utilities
SAPIEN Press tech books
ScriptingAnswers.com learn+share
ScriptingOutpost.com online store
Blog.Sapien.com official blog
Contact Us

 

New PrimalToys object for easier CSV handling

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’s scripting related newsgroups I couldn’t help but notice that questions regarding CSV keep coming up.

I mentioned this to one of our engineers, Stephen Poon, and he created this object that can edit and display CSV files really easily.

The following script is a PowerShell sample, a VBScript sample is included with PrimalScript 2007 (any edition) and the free PrimalToys download at our Free Tools Site

$CSVEdit = New-Object -comObject “SAPIEN.CSVEditor”
$CSVEdit.FirstRowColumnNames = $True
$CSVEdit.DataStartRow = 1
$CSVEdit.ReadOnly = $True
$CSVEdit.Title = “Current Processes Summary”
$CSVEdit.Label=”Processes:” #Text Label for the Grid

get-process | Export-Csv “C:\Temp\process.csv”
$CSVEdit.FileName = “C:\Temp\process.csv”
$CSVEdit.LoadFile()
$CSVEdit.ShowDialog()

Running this will produce this dialog:

image

The object includes a number of methods to insert, remove, extract columns rows or fields with or without displaying the UI.

Check it out and head over to our Free Tools forum at
http://support.sapien.com/forum/forum_topics.asp?FID=10
and let us know what you think and if  there is anything we should add.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Technorati Tags: , , , , ,

Tags: , , , , ,

2 Responses to “New PrimalToys object for easier CSV handling”

  1. fornetti Says:

    I do not believe this

  2. Recent Links Tagged With "csv" - JabberTags Says:

    [...] >> csv EasyCatalog connects InDesign to ODBC database Saved by Phoenix25 on Thu 16-10-2008 New PrimalToys object for easier CSV handling Saved by fenec on Thu 16-10-2008 CSV Import Saved by pgoerner on Wed 15-10-2008 Shareasale [...]

Leave a Reply


Entries (RSS) and Comments (RSS).