Sponsored Content
Top Forums Shell Programming and Scripting Substraction of matching lines from a file. Post 302846873 by Jojan Paul on Monday 26th of August 2013 02:50:15 AM
Old 08-26-2013
Wrench Substraction of matching lines from a file.

I have 2 files:
file1.txt contains

Code:
/html/mybook/Charts/143712/reptiles.pdf
/html/mybook/Charts/198459/spices.pdf
/html/mybook/Charts/198459/fresh_nuts.pdf
/html/mybook/Charts/123457/dome_anim.pdf
/html/mybook/Charts/123457/vegetables.pdf
/html/content/3DInteractive/174091/CSPSGGB.html

file2.txt contains

Code:
/html/mybook/Charts/123457/
/html/content/3DInteractive/174091/

I need out put file1.txt as (without creating a new file).

Code:
/html/mybook/Charts/143712/reptiles.pdf
/html/mybook/Charts/198459/spices.pdf
/html/mybook/Charts/198459/fresh_nuts.pdf

file1.txt should contain the lines after the subtraction of lines in file2.txt, It will be very helpful for me, if you have a solution for this.

Last edited by Scrutinizer; 08-26-2013 at 03:55 AM.. Reason: code tags
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading lines in a file matching a pattern

Hi, I need to redirect the lines in a file to a different file if the character starting from 2 to 6 in the line are numerical . Please let me know if anyone have any script to do this. Thanks, Ranjit (4 Replies)
Discussion started by: torenji
4 Replies

2. Shell Programming and Scripting

delete lines in file matching a pattern

I have a text file, a sample of which is as follows: r/- * 0: WINDOWS/Microsoft.NET/Framework/v2.0.50727/ASP.NETWebAdminFiles/Images/headerGRADIENT_Tall.gif r/- * 0: WINDOWS/SoftwareDistribution/Download/cf8ec753e88561d2ddb53e183dc05c3e/backoff.jpg r/- * 0: ... (2 Replies)
Discussion started by: stumpyuk
2 Replies

3. Shell Programming and Scripting

How to print file without few exactly matching lines?

Hi I have a very long file with 4 columns of numbers for example 1875 1876 12725 12723 13785 13786 4232 4230 13184 13185 ... (2 Replies)
Discussion started by: ananyob
2 Replies

4. Shell Programming and Scripting

Print lines matching value(s) in other file using awk

Hi, I have two comma separated files. I would like to see field 1 value of File1 exact match in field 2 of File2. If the value matches, then it should print matched lines from File2. I have achieved the results using cut, paste and egrep -f but I would like to use awk as it is efficient way and... (7 Replies)
Discussion started by: SBC
7 Replies

5. Shell Programming and Scripting

Finding lines matching the Pattern and their previous lines in a file

Hi, I am trying to locate the occurences of certain pattern like 'Possible network disconnect' in a text file. I can get the actual lines matching the pttern using: grep -w 'Possible network disconnect' file_name. But I am more interested in getting the timing of these events which are... (7 Replies)
Discussion started by: sagarparadkar
7 Replies

6. Shell Programming and Scripting

Print matching lines in a file

Hello everyone, I have a little script below: die "Usage infile outfile reGex" if @ARGV != 3; ($regex) = @ARGV; open(F,$ARGV) or die "Can't open"; open(FOUT,"+>$ARGV") or die "Can't open"; while (<F>) { print FOUT if /$regex/.../$regex/; } No matter what I give $regex on the... (2 Replies)
Discussion started by: new bie
2 Replies

7. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

8. Shell Programming and Scripting

awk to combine matching lines in file

I am trying to combine all matching lines in the tab-delimited using awk. The below runs but no output results. Thank you :). input chrX 110925349 110925532 ALG13 chrX 110925349 110925532 ALG13 chrX 110925349 110925532 ALG13 chrX 47433390 47433999 SYN1... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. UNIX for Beginners Questions & Answers

awk to average matching lines in file

The awk below executes and is close (producing the first 4 columns in desired). However, when I add the sum of $7, I get nothing returned. Basically, I am trying to combine all the matching $4 in f1 and output them with the average of $7 in each match. Thank you :). f1 ... (2 Replies)
Discussion started by: cmccabe
2 Replies
PODOFOINCREMENTALUPDATES(1)				     podofoincrementalupdates				       PODOFOINCREMENTALUPDATES(1)

NAME
podofoincrementalupdates - Provides information about incremental updates in PDF files SYNOPSIS
podofoincrementalupdates [-e N out.pdf] file.pdf DESCRIPTION
podofoincrementalupdates is one of the command line tools from the PoDoFo library that provide several useful operations to work with PDF files. It can print information of incremental updates to file.pdf. By default the number of incremental updates will be printed. OPTIONS
-e N Extract the Nth update out.pdf Output PDF file. file.pdf Input PDF file. SEE ALSO
podofobox(1), podofocountpages(1), podofocrop(1), podofoencrypt(1), podofoimg2pdf(1), podofoimgextract(1), podofoimpose(1), podofomerge(1), podofopages(1), podofopdfinfo(1), podofotxt2pdf(1), podofotxtextract(1), podofouncompress(1), podofoxmp(1) AUTHORS
PoDoFo is written by Dominik Seichter <domseichter@web.de> and others. This manual page was written by Oleksandr Moskalenko <malex@debian.org> for the Debian Project (but may be used by others). PoDoFo 2010-12-09 PODOFOINCREMENTALUPDATES(1)
All times are GMT -4. The time now is 04:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy