Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> gawk help
mkingiii
post Oct 24 2006, 04:20 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 11
Joined: 24-October 06
Member No.: 7,558



I am sure this is a relatively simple problem, but I am a novice at linux and need the answer quickly as it is critical to other work. I need to find and replace the same text in multiple files. After a quick search of linux commands, I found a sight that attributed the command gawk with the ability to find and replace text. However, the sight does not give an example of the full sequence of commands to use gawk to find and replace text, only that it can be used to do it. I would greatly appreciate it if someone could provide me with an example of the full command sequence to find and replace text. Thank you for helping.
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
mkingiii
post Oct 25 2006, 08:39 PM
Post #2


Whats this Lie-nix Thing?
*

Group: Members
Posts: 11
Joined: 24-October 06
Member No.: 7,558



Ok I think I have it finally.

I ran the following command sequence:
gunzip ./aa1/prod/0/1/final.pdb.gz ; perl -pi -e 's/YSN/LYS/g' ./aa1/prod/0/1/final.pdb ; gzip ./aa1/prod/0/1/final.pdb

This appears to have worked. I tested it and I was able to run the analysis programs. So thanks for all you help. All I need to do now is figure out a way to implement this. What I have is a file containing a list of files to be modified for example

./aa1/prod/0/1/final.pdb.gz
./aa6/prod/50/1/final.pdb.gz
./aa4/prod/2/1/final.pdb.gz...etc

Any Ideas on how I can easily modify this file to have the aforementioned command sequence.
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th December 2017 - 03:06 PM