LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 12-31-2020, 10:10 AM   #1
joejobs
LQ Newbie
 
Registered: Dec 2020
Posts: 12

Rep: Reputation: Disabled
Remove a multi-line text from another text file


I need to remove a multi-line text (contained in a file) from another text file but only the first occurrence

The text file looks like this:

Quote:
the
quick
the
brown
quick
brown
fox
jumps
quick
brown
fox
And I need to remove the following lines (contained in a file)
Quote:
quick
brown
fox
And then the result will be:

Quote:
the
quick
the
brown
jumps
quick
brown
fox
 
Old 12-31-2020, 10:29 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,698

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
See your other identical post, which you deleted:
https://www.linuxquestions.org/quest...vi-4175687769/
 
  


Closed Thread

Tags
remove, replace, text



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Empty a File, Delete N Lines From a File, Remove Matching String From a File, And Remove Empty/Blank Lines From a File In Linux LXer Syndicated Linux News 0 11-22-2017 12:30 PM
best practice Multihead, multi-screen, multi-display or multi-monitor-Debian 8 lgtrean Linux - Software 1 10-14-2015 09:53 AM
[SOLVED] what's the difference between a multi-cpu , multi-core and a multi-thread system ? entz Linux - Hardware 11 12-20-2011 04:49 PM
Remove lines in a text file based on another text file asiandude Programming 10 01-29-2009 10:59 AM
C++ text file line by line/each line to string/array Dimitris Programming 15 03-11-2008 08:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration