Replace partial contents of file with contents read from other file
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 append the data. but i am seeing junk characters in between. request for help on this.
Please find below sample
File1.txt
File2.txt
my output file should look like
i am able to get the above file but some junk charcters are coming not sure how?
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Hi Friends,
I am new to this forum. Just struck up with a logic.
I have a csv file seperated by ":" (colons).
This csv file contains hostname and groups as follows:
HOSTNAME:VT Group
SGSGCT2AVPX001:Team1
SGSGCT2AVPX003:Team2
SGSGCT2AVPX005:Team2
PHMNCTTAVPX001:Team3
I want to... (2 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)
I have made a script something like this. I want it to read the contents of either file or directory but 'cat' and 'ls' is not working. Can anyone help me? I am a newbie in scripting so dont know much about it. I also dont know how can i put my code separatly on this forum
#!/bin/bash
echo... (9 Replies)
Hi, I'm trying to implement a C program on ubuntu which reads the contents of a file that is passed in as an argument and then displays it to the screen. So far I've cobbled together this from bits online but most of it is probably wrong as its all copied and pasted...
#include <stdio.h>... (2 Replies)
Hi Friends,
I have a file1 with 5 columns
a b c d e
f g h i j
I have file2 with 3 columns
1 2 3
4 5 6
I want to replace 3rd 4th and 5th columns in file1 with file2 contents, so the output would be
a b 1 2 3
f g 4 5 6
Thanks (6 Replies)
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (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)
Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file.
While reading and merging the file contents into a single file, Like to keep the format of the source file.
... (4 Replies)
Discussion started by: Siva SQL
4 Replies
LEARN ABOUT DEBIAN
ecaccess-file-move
ECACCESS-FILE-MOVE(1p) User Contributed Perl Documentation ECACCESS-FILE-MOVE(1p)NAME
ecaccess-file-move - Move or Rename ECaccess Files
SYNOPSIS
ecaccess-file-move -version|-help|-manual
ecaccess-file-move [-debug] source-ecaccess-file target-ecaccess-file
DESCRIPTION
Allow moving an ECaccess File. When the move occurs within the same ECaccess File System then it is a rename. When the move occurs across
two different ECaccess File Systems then first a copy is done and then a delete of the original file is done (e.g. similar to ecaccess-
file-copy ... -erase).
The source-ecaccess-file and target-ecaccess-file are in the form [domain:][/user-id/]path. Please read the "Shell commands -> File
Management" section of the "ecaccess" guide for more information on the ECaccess File System.
ARGUMENTS
source-ecaccess-file
The source ECaccess File name.
target-ecaccess-file
The target ECaccess File name.
OPTIONS -version
Display version number and exits.
-help Print a brief help message and exits.
-manual Prints the manual page and exits.
-debug Display the SOAP messages exchanged.
EXAMPLES
ecaccess-file-move ec:test1.txt ec:test2.txt
Rename the test1.txt file in the ECFS directory of the authenticated user in test2.txt.
ecaccess-file-move ec:test1.txt home:test2.txt
Copy the test1.txt file from the ECFS directory of the authenticated user to the test2.txt file in the $HOME directory of the authenticated
user, then delete the test1.txt file from ECFS.
SEE ALSO
ecaccess-file-delete, ecaccess-file-get, ecaccess-file-mget, ecaccess-file-modtime, ecaccess-file-mput, ecaccess-file-rmdir, ecaccess-file-
copy, ecaccess-file-dir, ecaccess-file-mdelete, ecaccess-file-mkdir, ecaccess-file-chmod, ecaccess-file-put, ecaccess-file-size and
ecaccess.
perl v5.14.2 2012-04-16 ECACCESS-FILE-MOVE(1p)