At 13:10 -0800 11/8/09, Michael Heth wrote:
>This is probably rudimentary but I can't find what I need so I thought  
>I would ask.
>
>I am massaging 11K emails that were in a proprietary archive database.  
>They were exported as a large text file. The field delimiters were  
>high ASCII characters as there might be embedded tabs and CRs. So now  
>I am trying to get the emails ready for importing into a proper  
>database. I need to find something that will preserve linebreaks but  
>that isn't something that would be recognized as the end of the record  
>like the CR.
>
>I want to search for CR and replace with something else. Then I can  
>change my field delimiters and add back the CRs at the end and I  
>should be good to go.
>
>But I only know \t and \r, is there a sequence for what I need?

First of all, be aware that bbedit converts all line breaks it identifies as it 
reads a file to \r which is the older Apple standard carriage return, Hex 0D. 
(Actually it's probably a 000D to get 16 bit unicode equivalents..)

The other line end is \n or hex 0A which is the UNIX standard. Now that Apple 
IS BSD UNIX that is pretty much the standard except for old files.

peecees use a \r\n pair which is the internet (and teletype of old) standard.

Be aware that in the classic Apple OS the meanings of the escapes \r and \n are 
swapped. That shouldn't bother you unless the escapes actually appear in the 
files.

Personally, I'd run to perl where I can set the lineend character(s) to 
anything and then read the file record by record using those high ASCII codes 
which I hope you know.  $/ = \255;, with the right code, should do it.

Is there any way to do that with bbedit? A perl factory to read a file? Those 
embedded tabs and line ends might well be mixed versions coming from divers 
mail clients.
-- 

--> In Christianity, man can have only one wife. This is known as monotony. <--

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to