Sponsored Content
Top Forums Shell Programming and Scripting Compare two string in two separate file and delete some line of file Post 302743347 by saleh67 on Wednesday 12th of December 2012 02:43:41 PM
Old 12-12-2012
Compare two string in two separate file and delete some line of file

Hi all
i want to write program with shell script that able compare two file content and if one of lines of file have # at the first of string or nothing find same string in one of two file . remove the line in second file that have not the string in first file. for example:

file 1:config-file.conf
{
</sound>
snd sound card
snd1 sound card
<sound>
}
if user put # at first of string and save it , like: # snd sound card in config file
the program goes to second file for example
blacklist-sound.conf
{
blacklist snd sound card
blacklist snd1 sound card
}
and delete line blacklist snd sound card

or if user delet snd sound card string in config file , and then save it.program can remove blacklist snd sound card line
in blacklist -sound.conf

sorry for bad English
than x

---------- Post updated at 02:43 PM ---------- Previous update was at 02:30 PM ----------

I should mention that both are required to be written in one shell script .means both
put # and remove string method work whit gather.
than x
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

compare two .dat files and if there is any difference pulled into a separate file

Hi, compare two .dat files and difference will be moved into separate file.if anybody having code for this please send asap. using diff command, i don't know how to write shell programming. and my first file is like this including Header and trailer 10Ç20060323Ç01(Header) 01ÇIÇbabuÇ3000 01ÇIÇbaluÇ4000... (1 Reply)
Discussion started by: kirankumar
1 Replies

2. UNIX for Advanced & Expert Users

delete line from file if successful partial string found

Id like to delete a line from a file using (preferably a single line unix command) if it contains a certain string pattern. If line contains "abcdef" then delete that line. Help greatly appreciated. (7 Replies)
Discussion started by: cronjob78
7 Replies

3. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

4. Shell Programming and Scripting

Compare large file and identify difference in separate file

I have a very large system generated file containing around 500K rows size 100MB like following HOME|ALICE STREET|3||NEW LISTING HOME|NEWPORT STREET|1||NEW LISTING HOME|KING STREET|5||NEW LISTING HOME|WINSOME AVENUE|4||MODIFICATION CAR|TOYOTA|4||NEW LISTING CAR|FORD|4||NEW... (9 Replies)
Discussion started by: jubaier
9 Replies

5. Shell Programming and Scripting

delete the line with a particular string in a file using sed command.

Hello, I want to delete all lines with given string in file1 and the string val is dynamic. Can this be done using sed command. Sample: vars="test twinning yellow" for i in $vars do grep $i file1 if then echo "Do Nothing" else sed `/$i/d` file1 fi done Using the above... (5 Replies)
Discussion started by: PrasadAruna
5 Replies

6. UNIX for Dummies Questions & Answers

using sed delete a line from csv file based on specific data in two separate fields

Hello, :wall: I have a 12 column csv file. I wish to delete the entire line if column 7 = hello and column 12 = goodbye. I have tried everything that I can find in all of my ref books. I know this does not work /^*,*,*,*,*,*,"hello",*,*,*,*,"goodbye"/d Any ideas? Thanks Please... (2 Replies)
Discussion started by: Chris Eagleson
2 Replies

7. UNIX for Advanced & Expert Users

How to find a string in a line in UNIX file and delete that line and previous 3 lines ?

Hi , i have a file with data as below.This is same file. But actual file contains to many rows. i want to search for a string "Field 039 00" and delete that line and previous 3 lines in that file.. Can some body suggested me how can i do using either sed or awk command ? Field 004... (7 Replies)
Discussion started by: vadlamudy
7 Replies

8. UNIX for Dummies Questions & Answers

Search for a string,delete the line and replace with new string in a file

Hi Everyone, I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file. I am very new to unix. Kindly help... (10 Replies)
Discussion started by: Pradhikshan
10 Replies

9. Shell Programming and Scripting

Trying to use diff output to compare to a separate file

I have two files: smw:/working/iso_testing # cat a QConvergeConsoleCLI-1.1.03-49.x86_64.rpm aaa_base-13.2+git20140911.61c1681-1.3.i586.rpm acpica-20140724-2.1.2.i586.rpm test.rpm smw:/working/iso_testing # cat b QConvergeConsoleCLI-1.1.03-49.x86_64.rpm... (12 Replies)
Discussion started by: jedlund21
12 Replies

10. UNIX for Beginners Questions & Answers

Need help with how to search a file for a variable string and delete that line

Hi, I have a working script. It does what I am intending it to but a bit confused whether the sed part is supposed to be working or not. Further down is the script with the sed part that should have been working but not and the grep -v part which is the workaround that I am using at the... (10 Replies)
Discussion started by: newbie_01
10 Replies
gmfsk(1)																  gmfsk(1)

NAME
gmfsk - MFSK terminal for GNOME SYNOPSIS
gmfsk DESCRIPTION
gmfsk is a terminal for MFSK16, RTTY and Throb, three digital modulation formats used on HF radio particularly by radio amateurs. MFSK is an acronym for multi-tone frequency shift keying. gmfsk demodulates signals received through the sound card and displays the resulting text on the screen. In transmit mode, typed text is modulated and transmitted through the sound card. Circuits for connecting the sound card to a receiver or transceiver are readily available on the web. OPTIONS
Standard GNOME options may be used. GMFSK must be configured through the "Settings" menu when first used. NOTES
MFSK activity is commonly found around 14.080 MHz on the amateur 20m band. Although GMFSK is free software, transmission of any signal and of MFSK, RTTY and/or Throb signals in particular is subject to the laws of the government of your country. Receiving on non-amateur frequencies may also be prohibited. SEE ALSO
More information on MFSK16 can be found at http://www.qsl.net/zl1bpu/MFSK/INDEX.html AUTHOR
gmfsk was written by Tomi Manninen, OH2BNS <oh2bns@sral.fi>. This manual page was written by Hamish Moffatt VK3SB <hamish@debian.org> for Debian (but may be used by others). 15 October 2002 gmfsk(1)
All times are GMT -4. The time now is 10:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy