[PLUG-TALK] Emacs Regex Replace Phrase

Rich Shepard rshepard at appl-ecosys.com
Sun Sep 12 14:50:06 UTC 2010


On Sat, 11 Sep 2010, wes wrote:

> I don't know emacs, but I'm really lazy and use a solution that works, even
> if it's not "right." I would do 10 substitutions, =0 through =9.

wes,

   That works for the first digit on the string, but not for the final one. A
generic search, e.g., for '0,' will hit anything, including non-target
strings.

   The context are downloaded rows from an on-line business directory where
the ZIP code is apparently stored as numbers rather than text, and where fax
and toll-free phone numbers are also numbers rather than text and as a
continuous string rather than partitioned into area code, exchange, and
number.

   While OpenOffice.org's Calc can correctly format these for display (and
convert from number to text) that does not change the underlying .csv file.
I am inserting these data into a SQLite table, and realized that all columns
can have the storage attribute of text so I don't need to fret about the ZIP
code not being surrounded by double quotes. I've not yet figured out how to
reformat the fax and toll-free strings.

Rich



More information about the PLUG-talk mailing list