help with: sed '/^END/,/^BEGIN/d'

help with: sed '/^END/,/^BEGIN/d'

Post by Brian Rank » Thu, 18 Apr 1996 04:00:00



This extracts a uuencoded file out of the body of a mail message that contains
a uuencoded file.  But:  suppose there is "opening text" ("attached is a MS
Word document containing...").  How can I extract this text?

I'm sure the answer is right in front of me, but I can't find my sed manual...

Brian Rankin

 
 
 

help with: sed '/^END/,/^BEGIN/d'

Post by Bill Marc » Fri, 19 Apr 1996 04:00:00



>This extracts a uuencoded file out of the body of a mail message that contains
>a uuencoded file.  But:  suppose there is "opening text" ("attached is a MS
>Word document containing...").  How can I extract this text?

>I'm sure the answer is right in front of me, but I can't find my sed manual...

>Brian Rankin

sed '1,/^begin/p' >file

--

From the future home of the 270 Foot Jesus

 
 
 

help with: sed '/^END/,/^BEGIN/d'

Post by balthaza » Tue, 30 Apr 1996 04:00:00


 >This extracts a uuencoded file out of the body of a mail message that contains
 >a uuencoded file.  But:  suppose there is "opening text" ("attached is a MS
 >Word document containing...").  How can I extract this text?
 >
 >I'm sure the answer is right in front of me, but I can't find my sed manual...
 >
 >Brian Rankin
 >

        sed -n '/begin/,/end/p' file

--

       "The only way to rid oneself of"
       "temptation is to yield to it"

 
 
 

1. sed -e 's/\'a\'/\';\'/' ?

Hi,

my question is, how can I mask the single
quotation mark in my file for sed

I have a lot of SQL-Loader files of this kind:

cat t55.ctl
load data
infile 't55'
truncate
into table A_220_T55
fields terminated by ';' TRAILING NULLCOLS
(AAA_000_KEY    char ,
B_220_BBB_LFD_NR char ,
AAA_220_BBB     char )

there is given a delimiter ';'

The delimiter should be changed to a.

#!/bin/ksh
#set -x
for file in t*.ctl
do
sed -e 's/;/a/' $file >$file.new
mv $file.new $file
done

That's ok.

Now the delimiter should be rechanged from a to ;.
I'd tried

sed -e 's/\'a\'/\';\'/' $file >$file.new

It doesn't work.

How to mask the single quotation mark inside the sed command?

TIA,

Nele

2. All Linux users are stupid! WAS - Linux Pathetic Toy

3. sed and '/' to '\/' conversion.

4. kde icons etc...

5. Does sed '/'$var'/d' textfile work if $var has / in it???

6. Dumped out of Linux

7. alpha sort: 'sed'/'awk'?

8. CD ROM Drive crash

9. sed -e s/\'/\&apos\;/g doesn't seem to work

10. sed '/$^/d'

11. sed -e '/^t\{2,\}/d' foo

12. Can 'require' override 'allow'/'deny' (Apache)

13. (sed 1q ; sed 2q) : no output from 2nd 'sed'