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
> Using AWK,GREP,SED,etc, Reading text from one file and using it to replace text in another
qbgem
post Jul 29 2013, 07:37 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 29-July 13
Member No.: 18,428



Hello,

I trying to take values from a file and use those values to replace a value in other files.

Data file looks something like this

1
2
3
4.5
3.1


The number of files I need to replace a value in is the same as the length of the data file

This is an example 1st file in the directory
the value I need lies somewhere in the file
WGT=1
The previous line is where I need to replace the 1 with the first value in the data file
the only way I can see this working is to read in the files in the same order as the the values appear in the data file
which is easy to do but I can't seem to find a way to pipe the 1st line of the data file into a gsub type function

Thanks for any help you can provide.

Go to the top of the page
 
+Quote Post

Posts in this topic
- qbgem   Using AWK,GREP,SED,etc   Jul 29 2013, 07:37 PM


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: 17th December 2017 - 06:25 PM