Re: Vim scripting - cursor motion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 6/9/2011 10:07 AM, Jussi Hirvi wrote:
> On 9.6.2011 18.01, m.roth@xxxxxxxxx wrote:
>> Why do vim scripting? That's what sed, or awk, or perl, are for. The
>> latter two, of course, are much easier to comprehend the logic, too.
>
> Maybe just because I know vim better than sed, awk or perl, which I
> haven't used at all. :-)

The regexp parts will just have minor syntax differences.

> The practical purpose is to turn a tabtext file into CSV
> (comma-separated) to be used in a SQL insert statement.

I'd highly recommend perl for this because it can also do the SQL part 
directly via DBI without all of the intermediate contortions you'll have 
to do in files otherwise.  It should take about half a page of your own 
code to connect to the DB, read the file, transform it line-by-line to 
sql and execute the sql statements.  And unlike other approaches with a 
pipeline of different tools, you can generate sensible error messages in 
the right places that have something to do with the input.

-- 
   Les Mikesell
    lesmikesell@xxxxxxxx
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux