How to extract specific columns/line items from a CSV file?

Peter TB Brett peter.brett at livecode.com
Mon Sep 26 07:51:57 EDT 2016



On 20/09/2016 21:16, Keith Clarke wrote:
> Hi folks, I’ve a large number of sizeable CSV files from each of
> which I need to extract just 2 or 3 specific columns. Creating nested
> iterations through every item in every line seems somewhat
> inefficient - as does loading each full file into memory - so I feel
> I must be missing a trick here.
>
> Does Livecode support any elegant way of directly manipulating or
> ‘querying’ (like SQL) delimited data, to extract numbered (or named)
> columns/items - such as 1(Id), 3(Name) & 15(Summary) - from in each
> line from a CSV container or direct from a file/URL?

I would probably just use Mike Kerner's libraries:
https://github.com/macMikey/csvToText

                                       Peter

-- 
Dr Peter Brett <peter.brett at livecode.com>
LiveCode Technical Project Manager

lcb-mode for Emacs: https://github.com/peter-b/lcb-mode




More information about the use-livecode mailing list