Incoming from Curtis Sloan:
> On Thu September 23 2004 22:53, s. keeling wrote:
>
> > All of those work well for simple content mangling. However, that bit
> > about "each additional line after the first must start with a space"
> > is non-trivial.
>
> Let me try to simplify: I need to add a space to the beginning of every line
> in every DESCRIPTION section. However, I can't do a global replace (add a
> space to the beginning of _every_ line in the file) because the vCal format
> gets wrecked and won't import anymore.
So, to do this, you need to tell your solution what point in a
DESCRIPTION section is the beginning, and what defines the end of the
section. If it's:
DESCRIPTION SECTION:
blah, blah, blah,
blah.
SOMEOTHERSECTION:
yada, yada, ...
It's simple; there's a blank line between sections. You can scan for
"DESCRIPTION SECTION", read another line, substitute a space for start
of line (:%s/^/ /g), then append the rest of the line. Do that until
you hit a blank line.
If it's not so simple as that to determine start and end of the
section, you could do it in two steps. First, bracket each section
with start and end tags ("@_blah!!@" or something), then process using
those tags, removing them at the end.
> Basically, I need a programmatic way to determine the beginning and end of
> every DESCRIPTION section and only do the replace on those blocks of text. I
Yup. So, can you use "DESCRIPTION SECTION" as a tag for the start of
data? What signifies the end of that section and the beginning of another?
> Thanks, that's an excellent utility! I see \r \n being used regularly, but my
> question to myself is, why won't korganizer parse the ones in the DESCRIPTION
> field?. Or probably more to the point, how can I work around it? Is there a
I'd be tempted to simply wipe it of \r's everywhere and see what
happens. Good thing you've a copy. :-)
--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://www.spots.ab.ca/~keeling
- -
_______________________________________________
clug-talk mailing list
[EMAIL PROTECTED]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca