Question about Include functionality...

Skip to first unread message

Brian

unread,
Dec 26, 2009, 9:22:03 PM12/26/09
to BBEdit Talk
Hi,
I'm fairly new to the HTML features of BBEdit. One of the reasons I
started using it is for the relatively straightforward include/
placeholder/variable functionality. I have not been able to think of
a way to manipulate them to accomplish this:

Have a standard inline persistent include in an HTML doc;
The include file is a simple txt doc with 20 or so lines, each of them
a date;
Instead of including the *whole* txt file in the HTML doc, have it
*only* include some defined portion of the txt file-- i.e. certain
line numbers, or mark them with identifiers (Date1, Date2, etc.).

Is this possible? I know it could be done with 20 different include
files (1 per date), but I was hoping it might be possible with just 1?

I imagine with some Perl or Python chops, maybe? I have no skills
there, just basic unix shell scripting.

Many thanks,
Brian

Bill Hernandez

unread,
Dec 28, 2009, 12:51:43 AM12/28/09
to bbe...@googlegroups.com

Brian,

This would be fairly straight-forward to with php, if you have some sample text, I might be able to help.

Best Regards,

Bill Hernandez
Plano, Texas

Dave

unread,
Dec 27, 2009, 11:35:28 PM12/27/09
to BBEdit Talk
If I were doing this in jsp, I'd get the path to the file that's
including it (${pageContext.request.requestURI}), and use ifs to print
different lines in different files.

But I'd only do that if I had to include the whole file for some
reason. I'd much rather put each line in a different file. In general,
you should make everything as atomic as possible so you can reuse
resources with a minimum of redundancy.

Brian

unread,
Dec 29, 2009, 3:01:00 AM12/29/09
to BBEdit Talk
Thanks Guys...I think in this case 20 individual files might be a
little harder to manage than would be ideal, but I see the point and
it's well-taken. I wanted to know if it was possible without outside
scripting, and since it's not, I'll deal with the 20 files rather than
introduce that potential racket of issues.

Thanks again,
Brian

Charlie Garrison

unread,
Dec 29, 2009, 9:35:51 AM12/29/09
to bbe...@googlegroups.com
Good morning,

On 29/12/09 at 12:01 AM -0800, Brian <br...@whattheheller.com> wrote:

>Thanks Guys...I think in this case 20 individual files might be a
>little harder to manage than would be ideal, but I see the point and
>it's well-taken. I wanted to know if it was possible without outside
>scripting, and since it's not, I'll deal with the 20 files rather than
>introduce that potential racket of issues.

I could be done easily enough with BB Includes; I don't think
you've had any applicable suggestions since anyone with specific
ideas on how to help is having to guess at what you really want
to do. You've already received a couple of 'generic' answers. If
you want more than that then supply some *specific* examples of
what you're trying to do. Any number of scripting languages can
do what you want quite easily; give us some examples and I'm
sure someone will give some solutions.

My quick/generic solution is something like this in AppleScript:

set theLine to item j of { <lines from your simple txt doc> }
return theLine

Also, you say you have basic unix shell scripting skills; I see
no reason why you couldn't do this in a bash script as well.
BBEdit is great that way; use the tools that make most sense to you.


Charlie

--
Ꮚ Charlie Garrison ♊ <garr...@zeta.org.au>
〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

Reply all
Reply to author
Forward
0 new messages