I tried doing the following

next if s?\([ /]\)\./?\1?g;

For some reason it is not removing the ./ from the file. Any suggestions are welcome.
The file is in this format


a b ./dsfj/dfl/dksl ./ksdfl/dsld

c d ./sds/dsl/dksld ./kdf/ksd/ksdk

Thanks

Raghu

In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote:

In article <[EMAIL PROTECTED]>, Raghu Murthy wrote:

I need to remove ./ and #from a list of files. I can do it in sed but I
am not able to use it in my perl script. I tried to do something like
this

chomp ($txtlist = <STDIN>);
qx' sed -e "/^#/d $txtlist'; # To remove lines starting with a #
qx' sed -e"s?\([  /]\)\./?\1?g" $txtlist; # To remove lines starting with
a ./

I can do it if i hard code the file name but if i try to use $txtlist it
does not work. What am i doing wrong.

Thinking that I misunderstood the question... $txtlist is the file you want to edit?

If you call the script so: ./strip_chars txtlistfile > new_version

then you would start the code I posted with "while (<>) {" instead.


-- Kevin Pfeiffer

_________________________________________________________________
Fretting that your Hotmail account may expire because you forgot to sign in enough? Get Hotmail Extra Storage today! http://join.msn.com/?PAGE=features/es



-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to