[CALUG] Reading CSV using Python / PHP

Bryan Smith b.j.smith at ieee.org
Thu Apr 28 12:13:22 EDT 2016


Huh, that's a heck of an use case for Splunk!  ;)

If the user isn't looking for a programmatic method, that's an
interesting one, indeed.

BTW, in case anyone didn't know, non-Microsoft spreadsheet programs,
like Gnumeric and Calc already do CSV much better than Excel.  It's
one of the main reasons I argue LibreOffice (Calc) be on every Windows
computer, especially when Excel "enriches" a CSV with its tags (and
makes it an Excel file) and otherwise fouls everything up (just like
Word does to RTF, makes it a Word file).  Excel also lacks a lot of
key goodies that "just make sense" if you've used Gnumeric or Calc for
CSVs (most haven't, and don't realize how limiting Excel is).

But I've always loved Gnumeric most for its CSV, at least in the past.
It also uses Python as its macro language, so anything I did
programmatically using Python inside of Gnumeric could be adapted for
external use too.

Again, very interesting use case for Splunk ... I'll have to try it.  ;)

-- bjs



On Thu, Apr 28, 2016 at 11:58 AM, Daniel Deighton <ddeighton at aplura.com> wrote:
> You could try to accomplish your goals with the free version of Splunk. You
> can import, manipulate and export your CSV file.
>
> This blog post should get you started. In general, inputlookup and
> outputlookup are your friends with CSV files in Splunk.
>
> -Dan
>
> On 28 Apr 2016, at 10:36, Rajiv Gunja wrote:
>
> Hey all, I am trying to cut down on the amount of manual steps I have to
> take editing CSV file - sorting, creating new tabs and categorising them.
> I googled and found logparser from MS, could not figure it out - maybe a
> mental block towards anything MS.
>
> I saw that it was possible using python or PHP. So turning to you guys for
> advice. Which one works best or is there a different way?
>
> I do not know Python, but I can learn. PHP, I am very familiar with, but
> whichever is efficient and can do a better job, I will use it.
>
> Problem:
> 1. CSV file has 2000+ rows
> 2. Some columns are multi-line with \r and \n
> 3. fields are separated by "," and each data item is between quotes (" ")
>
> Please let me know.
>
> -GG
>
> ________________________________
>
> CALUG mailing list
> CALUG at unknownlamer.org
> http://lists.unknownlamer.org/listinfo/calug
>
>
> _______________________________________________
> CALUG mailing list
> CALUG at unknownlamer.org
> http://lists.unknownlamer.org/listinfo/calug
>



-- 

--
Bryan J Smith  -  http://www.linkedin.com/in/bjsmith
E-mail:  b.j.smith at ieee.org  or  me at bjsmith.me



More information about the CALUG mailing list