Page 2 of 2

Re: regex problem: convert CSV to comma delimited

Posted: Fri Jul 25, 2014 9:11 pm
by FourthWorld
Seems to be an unfortunate convention: techies love TLAs (three-letter acronyms) so much that "CSV" has become somewhat generic for referring to any flat delimited formats, even those that don't actually separate values with commas at all.

I haven't used Excel in many years since I switched to Libre Office, but I think they may have similar options for export in terms of being able to both choose tab as the delimiter and turn off the option of adding quotes for textual values.

With that output you can use the data in LC directly very efficiently, parsing by setting the itemdel to tab and displaying in a simple field object with the hGrid and vGrid set to true.

And yep, I was very active in the HyperCard community, going back even before the Web was invented to the old CompuServe days. Nice to be remembered - thanks.

Re: regex problem: convert CSV to comma delimited

Posted: Fri Jul 25, 2014 10:27 pm
by kaveh1000
Richard, I think you might have solved another problem and I can go back to TSV. I had been trying to display the data in a datagrid, but it was just too complex. I had no idea about hgrid and vgrid. I will now investigate. Does a tab move data into a new cell? How do you show the data correctly in a field with hgrid and vgrid on?

Re: regex problem: convert CSV to comma delimited

Posted: Fri Jul 25, 2014 10:29 pm
by richmond62
As LibreOffice is, effectively, a clone of Microsoft Office, LibreOffice Calc is very close to Excel.

Today I wanted to export a TAB delimited text file (ending in .csv) from LibreOffice; but couldn't find out
how to do it. However I found instructions on how to do this for Excel on the internet; and followed those instructions
to do it from Calc.

LibreOffice Calc allows you to delimit your textfile with whatever you want, so there should be no need (as long as you have access
to a copy of Calc (which WILL parse Excel fines)) to work out fancy and convoluted routines in Livecode to differentiate between when a QUOTE is a "
and not a delimiter.

Re: regex problem: convert CSV to comma delimited

Posted: Fri Jul 25, 2014 10:31 pm
by richmond62
"I had been trying to display the data in a datagrid, but it was just too complex."

Indeed it is: but a Table Field will take care of a delimited text field quite acceptably.

Re: regex problem: convert CSV to comma delimited

Posted: Fri Jul 25, 2014 10:39 pm
by richmond62
This chap seems to know what he's doing:

http://www.codingmonkeys.com/index.php?topic=2398.0

Re: regex problem: convert CSV to comma delimited

Posted: Fri Jul 25, 2014 10:45 pm
by kaveh1000
Guys, you have all been incredibly helpful. I am giving a live demo of a software next week, made using LiveCode, and it's going to look much smarter now hopefully. :-)

Re: regex problem: convert CSV to comma delimited

Posted: Sat Jul 26, 2014 3:05 am
by Simon
Heck, tossing all your data out the window and hitting yourself with a hammer is better than CSV. ;)
LMAO

Simon