BBEdit to web

50 views
Skip to first unread message

Andrew Brown

unread,
Nov 27, 2019, 8:42:25 AM11/27/19
to bbe...@googlegroups.com
Working on a collection of aged tagged files coming from InDesign I am cleaning up the coding with FileMaker Pro 16, running a series of lengthy substitute calculations while cursing FMP for being grepless. This works well for me in spite of the obvious limitations of FMP as a text editor — I frequently copy texts out to process them in BBEdit.

Is there any way that BBEdit could function in the same way, with immediate and automatic search-and-replace while retaining the original file unchanged? Perhaps something in php to run a file through str_replace and insert the result into a specific record in a MySQL database ?

I have been unable to persuade FMP to upload records to our remote MySQL database and have not yet found any relevant and comprehensible advice online. I have ODBC Manager which might or might not be what I need.

Is there any way of feeding files from BBEdit direct into a MySQL database?

Thanks.

AB

Jan Erik Moström

unread,
Nov 27, 2019, 9:12:35 AM11/27/19
to bbe...@googlegroups.com
On 27 Nov 2019, at 8:02, Andrew Brown wrote:

> Is there any way of feeding files from BBEdit direct into a MySQL
> database?

This is a really wild idea which might or might not be useful.

If the data that you want to clean up is really regular/structured you
could perhaps use text factories to clean up the data and generate SQL
commands that you then feed to the MySQL database.

Other possible way is to write a Python script which then talk to the
database to insert the data.

But it all depends on how the data is structured and looks like.

Also, it's probably easier to use some kind of direct MySQL library
(depending on what tools you decide to use) as ODBC strength in the
cross-platform (different databases) properties (at least this is how I
understand it). If this is a one-time thing it's probably easier to
simple use the built-in library in some language or directly use the
mysql command line tool.

I haven't done anything major myself, but I have several time generated
a file with SQL commands which I then have loaded into a database from
the command line.

= jem

Harvey Pikelberger

unread,
Nov 29, 2019, 9:25:20 AM11/29/19
to bbe...@googlegroups.com

Definitely the PHP process can be made to work, and if you’re familiar with JS, Node is maybe a little cleaner and more fluent an environment for what you want to achieve.  ”string”.replace(), for instance, uses native regexp, which is clearer and more powerful than str_replace.  Either way though — Both PHP and JS offer the option to run command line and grep out data and also do the cleaning/prepping and pushing to FMP or SQL in ways that leave the originals untouched.

BBEdit, is a truly excellent text editor, but for what you’re doing it’s probably better for writing up the automation than doing the automation.


On Nov 27, 2019, at 05:42, Andrew Brown <li...@c18.org> wrote:

Working on a collection of aged tagged files coming from InDesign I am cleaning up the coding with FileMaker Pro 16, running a series of lengthy substitute calculations while cursing FMP for being grepless. This works well for me in spite of the obvious limitations of FMP as a text editor — I frequently copy texts out to process them in BBEdit.

Is there any way that BBEdit could function in the same way, with immediate and automatic search-and-replace while retaining the original file unchanged? Perhaps something in php to run a file through str_replace and insert the result into a specific record in a MySQL database ?

I have been unable to persuade FMP to upload records to our remote MySQL database and have not yet found any relevant and comprehensible advice online. I have ODBC Manager which might or might not be what I need.

Is there any way of feeding files from BBEdit direct into a MySQL database?

Thanks.

AB

--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/B60F4E0D-78F9-490B-B17D-DA9CF23F0CED%40c18.org.

David Donachie

unread,
Nov 29, 2019, 10:15:08 AM11/29/19
to bbe...@googlegroups.com


> On 27 Nov 2019, at 14:46, Harvey Pikelberger <comm...@gmail.com> wrote:
>
> 
> Definitely the PHP process can be made to work, and if you’re familiar with JS, Node is maybe a little cleaner and more fluent an environment for what you want to achieve. ”string”.replace(), for instance, uses native regexp, which is clearer and more powerful than str_replace. Either way though — Both PHP and JS offer the option to run command line and grep out data and also do the cleaning/prepping and pushing to FMP or SQL in ways that leave the originals untouched.
>
> BBEdit, is a truly excellent text editor, but for what you’re doing it’s probably better for writing up the automation than doing the automation.

On the PHP side, if you stick with that (as it is designed originally as a text processor, it is a perfectly good choice as well) you will probably want to use preg_replace instead of the less powerful str_replace, to get the full PCRE implementation.

David

Harvey Pikelberger

unread,
Nov 29, 2019, 10:35:30 AM11/29/19
to bbe...@googlegroups.com
+1

Thanks for the reminder

Andrew Brown

unread,
Nov 30, 2019, 8:53:30 AM11/30/19
to bbe...@googlegroups.com
> On the PHP side, if you stick with that (as it is designed originally as a text processor, it is a perfectly good choice as well) you will probably want to use preg_replace instead of the less powerful str_replace, to get the full PCRE implementation.

Good point, David. Our files are still named str_replace... but are preg_replace inside, one day that fact may penetrate and stay. — AB


Reply all
Reply to author
Forward
0 new messages