Home » RDBMS Server » Server Administration » need help guys
need help guys [message #57665] Fri, 27 June 2003 13:45 Go to next message
sidd
Messages: 130
Registered: May 2003
Senior Member
Here is example i am working on.. hope u understand
this is the source file:
23444&#124jdjj&#124faksdf
23232 this nothing more
34343 no is there to do
89899&#124kdfsda&#124jasf
56565&#124ererere&#124fgdgfgddf
45442 I am the only men here

so i want the output file like this

output should be:
23444&#124jdjj&#124faksdf
#23232 this nothing more
#34343 no is there to do
89899&#124kdfsda&#124jasf
56565&#124ererere&#124fgdgfgddf
#45442 I am the only men here
Re: need help guys [message #57666 is a reply to message #57665] Fri, 27 June 2003 14:42 Go to previous messageGo to next message
Michel Bartov
Messages: 35
Registered: February 2003
Member
Do you want an awk script to do it - assuming you are on unix platform.
Re: need help guys [message #57667 is a reply to message #57666] Fri, 27 June 2003 14:55 Go to previous messageGo to next message
sidd
Messages: 130
Registered: May 2003
Senior Member
Yes, i am on UNIX.. yes awk or sed would work for me
Re: need help guys [message #57668 is a reply to message #57667] Fri, 27 June 2003 14:58 Go to previous messageGo to next message
Michel Bartov
Messages: 35
Registered: February 2003
Member
Try this

cat $1 | awk -F| '
{
if (NF <= 2)
printf("#%sn",$0)
else
printf("%sn",$0)
}
' > $1.new
Re: need help guys [message #57669 is a reply to message #57668] Fri, 27 June 2003 15:23 Go to previous message
sidd
Messages: 130
Registered: May 2003
Senior Member
Thanks a lot for your help men,
can you tell me what is good book for Unix shell scripting, i would appreciate that. thanks again
Previous Topic: need help guys
Next Topic: Rollback Segment
Goto Forum:
  


Current Time: Fri Sep 20 13:37:55 CDT 2024