Re: [AMBER] How to use perl to replace number to txt?

From: Chris Chris <alpharecept.yahoo.com>
Date: Thu, 31 Mar 2011 05:17:14 -0700 (PDT)

Learn how to use the unix command 'sed'. A linux forum like
http://www.linuxquestions.org/questions/

is more appropriate for such general questions.





________________________________
From: Catein Catherine <askamber23.hotmail.com>
To: amber.ambermd.org
Sent: Thu, March 31, 2011 5:48:48 AM
Subject: [AMBER] How to use perl to replace number to txt?


Dear Sir or Madam,

I was trying to use perl to do amber analysis.  One of my task is to replace the
(number 1 to 100) to a txt (xxx).

I was using the following command line in perl.

s/1...100/xxx/g

However, the program seems to have problem reading [1...100], as it only change
1 to xxx.

I tried to specifiy the 1...100 as follows

s/1,2,3,4,5,6,7,8,9,10,11,..../xxx/g

However, this time, only 1 to 10 was changed to xxxx.  The 10 was changed to
xxx0, 11, was changed to xxxxxx.  It seems to me that perl read 10 as 1 + 0, 11
as 1 + 0. 


Could you mind to give me a hand how to overcome this problem?  Are there any
easier way of doing this?

Best regards,

Catherine                        
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber



      
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Mar 31 2011 - 06:00:02 PDT
Custom Search