On Fri September 24 2004 10:17, s. keeling wrote: > 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. <snip> > > 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?
Aside: excuse me while I change my terminology mid-thread. I checked the RFC and the term I'm looking for is actually "property". It appears as though there is always a CLASS:PUBLIC property following each DESCRIPTION property (in this file, anyway). So that should do as a delimiter. Now, how do I go about testing for the start/end delimiters? Using readline? In a script? I'm not even sure where to start. Any suggestions welcomed. Thanks. > I'd be tempted to simply wipe it of \r's everywhere and see what > happens. Good thing you've a copy. :-) I've tried a few different ways to strip out all the \r's: -in vi, using :%s/\r//. Unfortunately, vi returns 'substitution failed'. Not sure why yet. -from a prompt: 'tr -d \r < Outlook2vCal_23-Sep-2004.vcs > Outlook2vCal_23-Sep-2004.vcs.nocr'. This worked, and the .nocr file is smaller than the original, but od -c still shows \r \n throughout! Again, I don't know why. Any pointers from anyone still welcome! And thanks for the help so far! Sincerely, Curtis P.S. FWIW, I found this explanation of carriage return, newline, et al. differences between systems simple and effective. http://www.mail-archive.com/redhat-list%40redhat.com/msg37700.html _______________________________________________ clug-talk mailing list [EMAIL PROTECTED] http://clug.ca/mailman/listinfo/clug-talk_clug.ca

