Jul 18, 2006 #1 Bigcat37 Technical User Joined Oct 24, 2005 Messages 13 Location FR Hi how to translate the string aaZ to aZ in my file. I'm on AIX 5.3 and 5.2 my file is aaZgteksklkfi. how to obtain aZgteksklkfi Thanks you Regards Denis
Hi how to translate the string aaZ to aZ in my file. I'm on AIX 5.3 and 5.2 my file is aaZgteksklkfi. how to obtain aZgteksklkfi Thanks you Regards Denis
Jul 18, 2006 #2 khalidaaa Technical User Joined Jan 19, 2006 Messages 2,323 Location BH What do you mean by Translation? Do you mean replacing the aaZ with aZ? Upvote 0 Downvote
Jul 18, 2006 Thread starter #3 Bigcat37 Technical User Joined Oct 24, 2005 Messages 13 Location FR I want to substitute the substring aaZ by aZ. Regards Denis Upvote 0 Downvote
Jul 18, 2006 #4 mrn MIS Joined Apr 27, 2001 Messages 3,993 Location GB I'm a little confused too, do you mean the filename or the file contents? sed -e 's/aaZ/aZ' or mv aaZgteksklkfi aZgteksklkfi or tr 'aaZ' 'aZ' < inputfile > outputfile Mike "When we ask for advice, we are usually looking for an accomplice." Upvote 0 Downvote
I'm a little confused too, do you mean the filename or the file contents? sed -e 's/aaZ/aZ' or mv aaZgteksklkfi aZgteksklkfi or tr 'aaZ' 'aZ' < inputfile > outputfile Mike "When we ask for advice, we are usually looking for an accomplice."
Jul 18, 2006 Thread starter #5 Bigcat37 Technical User Joined Oct 24, 2005 Messages 13 Location FR Sorry Mike i mean the file contents. the command tr 'aaZ' 'aZ' < inputfile > outputfile doesn't work ! the problem is that aZ is smaller than aaZ ... Thanks Regards Denis Upvote 0 Downvote
Sorry Mike i mean the file contents. the command tr 'aaZ' 'aZ' < inputfile > outputfile doesn't work ! the problem is that aZ is smaller than aaZ ... Thanks Regards Denis
Jul 18, 2006 #6 khalidaaa Technical User Joined Jan 19, 2006 Messages 2,323 Location BH I think in here you have to create a loop that will look for the occurence of aaZ and replace it with aZ. I honestly don't have time to do this now but i will try to do it later in my spare time Regards, Khalid Upvote 0 Downvote
I think in here you have to create a loop that will look for the occurence of aaZ and replace it with aZ. I honestly don't have time to do this now but i will try to do it later in my spare time Regards, Khalid
Jul 19, 2006 1 #7 DSMARWAY Technical User Joined Jun 25, 2002 Messages 640 Location GB try as mrn suggested sed 's/aaZ/aZ/' f1 > f3 f1 is your source filename f3 is new file Upvote 0 Downvote