But, what if I have to only copy 2nd and 3rd column from file2 to 1st and second columns in file1.
How do I change the code? Is there a way to see all the column numbers in the code, so that when I work on my original data with thousands of columns, I could easily go back and forth?
Hi,
I want to replace the contents of a file.I tried using :
sed 's/01514581/01514582/' $p
where 01514581 is the original value
01514582 is the replaced value
$p is the file name (captured in a variable)..
The output does not recognise $p
If you give :
sed... (2 Replies)
Hi
I have a file that looks like this:
Line 0
animal elephant
Line 1
animal elephant
Line 2
animal elephant
Line 3
animal elephant
What i am aiming to do is with a script and an input value of... (6 Replies)
From the existing file, I need to replace specific contents possibly with var every time when the user changes the var.
e.g the contents in the file file.txt is 'My name is $n and I am $y years old' and every time user changed the var outside the file, the contents of the file should be created... (4 Replies)
Hi All,
Need help on this
I have 2 files
one file file1 which has several entries as :
define service{
hostgroup_name !host1,!host5,!host6,.*
service_description check_nrpe
}
define service{
hostgroup_name !host2,!host4,!host6,.*
service_description check_opt
}
another... (2 Replies)
Hi,
I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file.
i am able to... (2 Replies)
How can i replace the contents in a particular line of a file.
<FOLDERMAP SOURCEFOLDERNAME="FFCB-2012" SOURCEREPOSITORYNAME="Repo_DEV" TARGETFOLDERNAME="TEST" TARGETREPOSITORYNAME="Dev_Repo"/>
For Example I want to replace the SOURCEREPOSITORYNAME="Repo_DEV" to... (3 Replies)
Hello,
I need help to replace a value by a new one.
I've got a script, that will get directory size in ko, then write the size value return in a log file :
The patch is given in crontab, and use with $1 in the script.
I am looking for help to replace, after: the old value without to... (6 Replies)
Hello,
I have two files: file1 and file2
file1 has the following info:
---
host: "localhost"
port: 3000
reporter_type: "zookeeper"
zk_hosts:
- "localhost:2181"
file2 contains an IP address (1.1.1.1)
What I want to do is replace localhost with 1.1.1.1, so that the... (4 Replies)