Re: CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Keith Clarke via use-livecode
Ah, thanks Alex - I’ll dig into that. I did search around for CSV to TSV in several places before posting but not CSV to Tab and not github! Best, Keith > On 5 Apr 2022, at 18:17, Alex Tweedly via use-livecode > wrote: > > Hi Keith, > > that code will fail for any commas which occur within q

Re: CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Alex Tweedly via use-livecode
Hi Keith, that code will fail for any commas which occur within quoted entries - they will be wrongly converted to TABs I'd suggest getting cvsToTab (a community effort by Richard Gaskin, me and a whole host of others over the years) as a good starting place, and perhaps finishing place. It

Re: CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Keith Clarke via use-livecode
This code sits early in the process of preparing CSV file data (from files that I didn’t create, so their content is unknown) into TSV text for onward processing. So, the logic here is attempting to address the very concerns that you raise, albeit in reverse order i.e. - remove any tab charac

Re: CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Mike Kerner via use-livecode
I'm confused by the code, above. If you are using tab as your column delimiter, then you wouldn't replace it with a space, since your tsv/csv files would have tabs in them when they were exported, originally. In any case, when you are going to replace a character with another character, you should

CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Keith Clarke via use-livecode
Hi folks, Thanks all for the responses and ideas on consolidating multiple CSV files into - much appreciated. Ben - Thank you for sharing your working recipe. This lifted my spirits as it showed I was on the right path (very nearly!) and you moved me on a big step from where I was stuck. My

Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?

2022-04-04 Thread Bob Sneidar via use-livecode
Okay no answer to my question so here is why I ask. SQL databases typically have a limit on how many columns you can have, and how many total bytes a record will take. If it is possible to import each CSV file as a separate table, that would be ideal. If not you need to make yourself aware of th

Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?

2022-04-04 Thread Ben Rubinstein via use-livecode
Hi Keith, I feel your pain. I spend a lot of time doing this kind of manipulation. I generally avoid CSV, the format of the devil. If necessary I have a library that does a reasonable job of converting CSV to TSV, and run everything through that. Let's just assume for now that you've already d

Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?

2022-04-04 Thread Craig Newman via use-livecode
Hi. I rarely deal with the csv monster, but every time I have had to it all boiled down to the fact that a comma is a terrible character to use as a delimiter of ANY kind. Ideally it would be possible to simply replace every comma with a tab. The returns remain untouched. If that works, you ar

Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?

2022-04-04 Thread Bob Sneidar via use-livecode
Does all the data need to be in a single table? Sent from my iPhone > On Apr 4, 2022, at 10:31, Mike Kerner via use-livecode > wrote: > > keith, > are all the files structured the same way? are they all gathered in the > same place? > LC's big strength, IMHO, is text handling, so you're righ

Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?

2022-04-04 Thread Mike Kerner via use-livecode
keith, are all the files structured the same way? are they all gathered in the same place? LC's big strength, IMHO, is text handling, so you're right in its wheelhouse. for the simplest example, let's assume that all the files have all the same column layout and they're all in the same folder. in t

Tools & techniques for one-off consolidation of multiple 'similar' CSV files?

2022-04-04 Thread Keith Clarke via use-livecode
Hi folks, I need to consolidate a couple of hundred CSV files of varying sizes (dozens to hundreds of rows) and column structures (some shared columns but many unique), into a single superset dataset that comprises all data from all files. There are too many files and columns to attempt a manual