Article View: best.general
Article #1651Re: perl versions of sed commands?
From: Dave Brown
Date: Tue, 21 Nov 1995 00:00
Date: Tue, 21 Nov 1995 00:00
26 lines
1709 bytes
1709 bytes
In article <48o3if$qtp@shellx.best.com>, Zenin <zenin@best.com> wrote: : I'm having a problem with sed. -It doesn't like really long single lines. : (in the order of 100k+ plus characters... :) : : I'm hoping perl can handle them a little better. : So if I wanted to do somthing like "sed 's/string1/string2/g' filename" in : perl how would I do it? -From a sh script? perl -pe 's/string1/string2/g' filename It's in the man page for perl. : I also can't figure out how to put control characters and high ascii in : regular expressions. Is their a way to use their hex values? Tr can do it, : can sed? perl? awk? -The man pages haven't helped nor has the unix faq... In perl, you can put them in octal with backslashes, as in \033 for escape. Have fun getting that kind of stuff past shells if you're going to use perl -e constructs. --Dave -- http://armf18.dow.on.doe.ca:6700/~dbrown "On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."
Technical Details
Message-ID:
<48tbtm$o89@armf18.dow.on.doe.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<48o3if$qtp@shellx.best.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f9f6d,bf8145ae39ef9a25 X-Google-Attributes: gidf9f6d,public X-Google-Thread: 1012a6,bf8145ae39ef9a25 X-Google-Attributes: gid1012a6,public From: dbrown@armf18.dow.on.doe.ca (Dave Brown) Subject: Re: perl versions of sed commands? Date: 1995/11/21 Message-ID: <48tbtm$o89@armf18.dow.on.doe.ca> X-Deja-AN: 119942119 references: <48o3if$qtp@shellx.best.com> organization: None. Come on, this is the government! newsgroups: best.general,comp.unix.shell