Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
CSV export with return characters intratext (Read 1764 times)
Juan
Full Member
*
Offline



Posts: 10

CSV export with return characters intratext
Apr 16th, 2015, 6:38pm
 
I'm trying to export notes to CSV format, and I've succeeded in it thanks to the feedback given to other users, except for one thing which I've yet to figure out. How do I prevent line returns in $Text from breaking into "records" in the exported CSV?
I can't simply eliminate the line returns in $Text as I need them in the exported CSV.
I'm trying to export into FileMaker, if that makes a difference.

Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: CSV export with return characters intratext
Reply #1 - Apr 17th, 2015, 1:11pm
 
I believe that CSV  requires that you enclose the field that may contain newline characters in quotation marks.  That means, in turn, that the field may not contain quotation marks; if it does, those quotation marks need to be escaped (and I donít recall offhand exactly what convention CSV uses for this.)
Back to top
 
 
WWW   IP Logged
Juan
Full Member
*
Offline



Posts: 10

Re: CSV export with return characters intratext
Reply #2 - Apr 17th, 2015, 9:31pm
 
I fixed the problem!!

The problem is straight quotes vs. smart quotes. If I use smart quotes, I will get some encoding problems, so I changed the smart quotes, which all quotation marks were being converted into automatically, into straight quotes.
The escape character for quotation marks, is another quotation mark besides it.
So, if I want to convert:

"I'm going to say Kentucky will pull away."

I need to type it in as:
""I'm going to say Kentucky will pull away.""

Also, the export template looks like this:
^title^,"^text^"

moreover, I saved the item with a .csv extension.

I knew it was easy to import database stuff into TB, but I didn't know it was easy to re-export stuff into a database. Now I know. †Smiley

Thanks Mark for such a wonderful program!

BTW:
I found things that Mark Anderson wrote concerning quotes
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1341411495/0#0
http://www.acrobatfaq.com/atbref5/index/ActionsRules/Operators/FullOperatorList/...
Back to top
 
« Last Edit: Apr 17th, 2015, 10:28pm by Juan »  
  IP Logged
Juan
Full Member
*
Offline



Posts: 10

Re: CSV export with return characters intratext
Reply #3 - Apr 18th, 2015, 10:58pm
 
I ran into a small problem where I couldn't figure out how to convert all the smart quotes in the document to straight quotes, so I thought I'd share how to do that here:

Query:
$Text.contains(".*")
Action:
$Text = $Text.replace("ď",'""')
(I enlarged the size of the smart quote so it's visible)

You have to perhaps create two agents: one agent will search for all left smart quotes, and the other all right smart quotes and replace each with straight quotes.
I don't know of a simpler way to do this, but I think it works.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print