Home Download Buy Blog Forum Support

CSV

CSV

Postby emartel on Wed Mar 07, 2012 3:01 am

I made a simple CSV plugin called CSV on Will Bond's package control and available on github here: https://github.com/ericmartel/Sublime-Text-2-CSV-Plugin

So far it allows you to fix the first row if desired as header, sort your data (sort is string based, so 11 will appear before 2, for example) but I think most interestingly to format it with an arbitrary string... for example you could format your data using something like: <a href="{1}">{0} - {2}</a> for some data where the column 0 is the index, 1 is the url and 2 is the name.

I'll be working on a page to describe the example with actual data but in the mean time I'm open for feedback :)

I think allowing the possibility to assign types to columns for the sort would be good, but I'll only do it if people are interested in the plugin

Cheers

Eric
emartel
 
Posts: 23
Joined: Thu Feb 23, 2012 8:59 pm
Location: Montreal, Canada

Re: CSV

Postby planet on Wed Mar 07, 2012 9:39 am

Hi Eric,

I like your plugin idea! Unfortunately it is not working for my test case. Any command results in "csv: The buffer doesn't appear to be a CSV file". I think the plugin assumes the delimiter to be ',' but my test uses ';' (which is valid as far as i know). Furthermore, each data column is placed into double quotes, and can contain ',' or ';'. Here is a simple example (including a header):

col1;col2;col3
"1";"2,1";"3"
"4";"5;2";"6"


Greetings, Thorsten.
planet
 
Posts: 24
Joined: Fri Feb 17, 2012 12:30 pm

Re: CSV

Postby emartel on Wed Mar 07, 2012 12:06 pm

Hi,

I have to spend the day at the hospital but I'll add features to support that later tonight!

Thanks for the feedback :)

Edit: things didn't go as planned, tomorrow most likely
emartel
 
Posts: 23
Joined: Thu Feb 23, 2012 8:59 pm
Location: Montreal, Canada

Re: CSV

Postby emartel on Sat Mar 10, 2012 1:50 am

The plug in should now be working with the data you provided!
emartel
 
Posts: 23
Joined: Thu Feb 23, 2012 8:59 pm
Location: Montreal, Canada

Re: CSV

Postby planet on Thu Mar 15, 2012 3:53 pm

Hi Eric,

many thanks for working it over!
planet
 
Posts: 24
Joined: Fri Feb 17, 2012 12:30 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot] and 3 guests