Sponsored Content
Top Forums Shell Programming and Scripting I want to delete the contents of a file which are matching with contents of other file Post 302552185 by ranasheel2000 on Friday 2nd of September 2011 01:57:29 AM
Old 09-02-2011
I want to delete the contents of a file which are matching with contents of other file

Hi,

I want to delete the contents of a file which are matching with contents of other file in shell scripting.
Ex.
file1
Code:
sheel,sumit,1,2,3,4,5,6,7,8
sumit,rana,2,3,4,5,6,7,8,9
grade,pass,2,3,4,5,6,232,1,1
name,sur,33,1,4,12,3,5,6,8
sheel,pass,2,3,4,5,6,232,1,1

File2
Code:
grade,pass,2,3,4,5,6,232,1,1
sheel,pass,2,3,4,5,6,232,1,1


so i want to delete contents of file 1 by reading line by line from file2
Could any one please suggest as i need urgent help on this.

Thanks in Advance!!!!!

Last edited by Franklin52; 09-02-2011 at 03:42 AM.. Reason: Please use code tags for code and data samples, thank you
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating file contents using contents of another file

Hi, I am not sure how to start doing this so I hope to get some advice as to how to start. I have 2 files. The source file contains data that I needed is in columns delimited by ";". For example, in this format: "CONTINENT","COUNTRY","CITY","ID" "asia","japan","tokyo","123"... (21 Replies)
Discussion started by: ReV
21 Replies

2. Shell Programming and Scripting

Looking for a perl script (windows) to delete the contents of a file

Hi All, Im having a file named logserver.txt. I want a perl script to take a backup of that file, along with the datestamp; move the file to a different location or empty the contents of the file after backup. Remember, the file gets generated when the related service starts. My condition is... (14 Replies)
Discussion started by: ntgobinath
14 Replies

3. Shell Programming and Scripting

How can i delete the contents of one file based on another file

Hi all, I have two log files A and B. Where files A have 10 lines and file b has 5 lines. Out of them 3 lines are common to both of them. I want to compare both the files and want to delete the common data from file A(file B should remain as it is) example : file A : 1 2 3 4... (5 Replies)
Discussion started by: rdhanek
5 Replies

4. UNIX for Dummies Questions & Answers

compare 2 file contents , if same delete 2nd file contents

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)
Discussion started by: krishnampkkm
5 Replies

5. Shell Programming and Scripting

Matching two file contents and extracting associated information

Hi, I am new to shell programming and need help. I have File1 with some ID numbers and File2 with ID number and some associated information. I want to match the ID numbers from File1 to contents in File2 and output a third file which pulls out the ID numbers and the associated information with... (2 Replies)
Discussion started by: newpro
2 Replies

6. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: seeki
2 Replies

7. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

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)
Discussion started by: vivek d r
2 Replies

8. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies

9. UNIX for Beginners Questions & Answers

Output file name and file contents of multiple files to a single file

I am trying to consolidate multiple information files (<hostname>.Linux.nfslist) into one file so that I can import it into Excel. I can get the file contents with cat *Linux.nfslist >> nfslist.txt. I need each line prefaced with the hostname. I am unsure how to do this. --- Post updated at... (5 Replies)
Discussion started by: Kentlee65
5 Replies
UMCT(4) 						   BSD Kernel Interfaces Manual 						   UMCT(4)

NAME
umct -- Magic Control Technology USB-RS232 converter driver SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file: device umct device ucom Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): umct_load="YES" DESCRIPTION
The umct driver provides support for USB to RS-232 converters based on the Magic Control Technology USB-232 design. These devices support most of the standard RS-232 features including baud rates ranging from 300 to 115200 bits per second. However, neither hardware nor software flow control seems to be supported. Access to devices under this driver is via the ucom(4) framework and device nodes. HARDWARE
The umct driver supports the following adapters: o Belkin F5U109 o Belkin F5U409 o D-Link DU-H3SP USB BAY Hub o Magic Control Technology USB-232 o Sitecom USB-232 SEE ALSO
tty(4), ucom(4), usb(4) HISTORY
The umct driver appeared in FreeBSD 5.2. It is loosely based on the ubsa(4) driver by Alexander Kabaev <kan@FreeBSD.org> with documentation from Wolfgang Grandeggar <wolfgang@cec.ch>. AUTHORS
The umct driver was written by Scott Long <scottl@FreeBSD.org>. BSD
November 22, 2006 BSD
All times are GMT -4. The time now is 11:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy