help with awk/sed, please 
Author Message
 help with awk/sed, please

Hiya all,
i've been searching a long time now, but i still get no clue!
i would be very happy if you guys and gals could help me out.

***problem description:***
let's assume that i have a file with a path in it, say "/home/test", and now
i make an echo from that file and would like to delete the first slash, and
make a "newline" for the second.
*****
i already deleted the first / with " sed -e 's/\///'  " so the value of the
file is now "home/test"
now i would like to have a newline after home... so i'd like to replace the
"/" with a newline.
That should be the output:
home
test
-----
i already tried sed -e 's/\//\n/' , but that didn't work..... i really have
no clue anymore and would be happy if you could help me. it can be sed or
awk, i don't care.... it has just to work :)

Thanks for your help in advance.

Best regards,
Carisma



Thu, 01 Aug 2002 03:00:00 GMT  
 help with awk/sed, please

Quote:

>Hiya all,
>i've been searching a long time now, but i still get no clue!
>i would be very happy if you guys and gals could help me out.

>***problem description:***
>let's assume that i have a file with a path in it, say "/home/test", and now
>i make an echo from that file and would like to delete the first slash, and
>make a "newline" for the second.
>*****
>i already deleted the first / with " sed -e 's/\///'  " so the value of the
>file is now "home/test"
>now i would like to have a newline after home... so i'd like to replace the
>"/" with a newline.
>That should be the output:
>home
>test
>-----
>i already tried sed -e 's/\//\n/' , but that didn't work..... i really have
>no clue anymore and would be happy if you could help me. it can be sed or
>awk, i don't care.... it has just to work :)

Try sed -e 's/\//\
/'

Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,

  Die Anyway     |    v    | That no one could find fault with it.



Thu, 01 Aug 2002 03:00:00 GMT  
 help with awk/sed, please

   >i already deleted the first / with " sed -e 's/\///'  " so the
   >value of the file is now "home/test"
   >now i would like to have a newline after home... so i'd like to
   >replace the "/" with a newline.
   >That should be the output:
   >home
   >test
   >-----
   >i already tried sed -e 's/\//\n/' , but that didn't work..... i
   >really have no clue anymore and would be happy if you could help me.
Use a real newline, not \n.  And you don't need to write \/ if you use a
character other than / as the separator.
sed 's:/:
:'

Net-Tamer V 1.08X - Test Drive



Fri, 02 Aug 2002 03:00:00 GMT  
 help with awk/sed, please

Quote:
> And you don't need to write \/ if you use a
> character other than / as the separator.
> sed 's:/:
> :'

thank you so much for mentioning that i can use an other character as
separator. that solved my problem, haven't found it anywhere else.

stefan



Wed, 07 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need awk (or sed) help PLEASE!

2. Need help with sed or awk !!

3. sed/awk - grabbing column/pos help!!

4. new to sed/awk, need help badly

5. HELP with awk and sed to parse email

6. Sed/Awk help needed

7. Arrays in awk/awk help please!

8. please HELP with sed

9. Problem (sed) - please help

10. Newbie awk (sed??) question, regular expressions

11. Awk/Sed Filehandler question

12. sed, awk, perl

 

 
Powered by phpBB® Forum Software