Skip to content

Commit

Permalink
Add text-csv-headers skeleton
Browse files Browse the repository at this point in the history
I almost always want to use these three lines when I read a CSV in a
Perl program with the Text::CSV module. The skeleton saves me from
having to grep my code and copy and paste.
  • Loading branch information
Dyrcona committed Dec 8, 2023
1 parent 17daf89 commit de50758
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions elisp/my-skeletons.el
Expand Up @@ -333,6 +333,13 @@ skeleton output around the use statements."
?\n
"done_testing();\n")

(define-skeleton text-csv-headers
"Insert Perl code to read headers from first line of a csv using Text::CSV."
"Filehandle: "
> "my @cols = @{$csv->getline(" str ")};\n"
> "my $row = {};\n"
> "$csv->bind_columns(\\@{$row}{@cols});\n")

(define-skeleton pqxx+boost
"Insert a skeleton for a C++ program using libpqxx and boost to connect to PostgreSQL for Evergreen."
""
Expand Down

0 comments on commit de50758

Please sign in to comment.