How to remove the rest of the line after a specific string

rea

So I am trying to remove the rest of the line after specific string on a document but I am finding it hard.

The lines look similar to this

abc:abc|bca:111 222|ccc:01/01/17
abc:abc|bca:bca bca|ccc:02/02/17

I am trying to delete everything after abc:abc including | but I don't know how.

I tried it with this on notepad+ \|.bca* but when I click Replace all it selects whole document.

Toto
  • Ctrl+H
  • Find what: \|.*$
  • Replace with: LEAVE EMPTY
  • check Wrap around
  • check Regular expression
  • DO NOT CHECK . matches newline
  • Replace all

Explanation:

\|  : pipe character
.*  : 0 or more any character but newline
$   : end of line 

Result for given example:

abc:abc
abc:abc

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I delete rest of the line after a specific string?

How to remove a specific line that contains a specific string?

How to remove line with specific string from file

How to remove string after and before specific chars

python pandas how to remove after specific string?

how to insert line break after a specific string?

How to remove a blank line in text file after deleting a specific line?

Remove/Add Line Breaks after Specific String using Sublime Text

How to remove specific line from multi-line string

Java How to find a specific line after a specific string?

how to remove the last li::after for first line in specific width of an div

How to create a regex pattern to remove line breaks after specific tag

How to append a string to one specific line and remove a string from another specific line in a file?

How to retain a specific word in a string throughout the column and remove all the rest?

How to remove line containing a specific string from file?

How to remove a specific character in a string but only if there are no numbers in that line in Linux

How to remove every line starting with specific string from log file?

How to remove a line containing two specific string in text?

How do I remove the rest of a string after a character in a dataframe column?

How to delete the rest of each line after a certain pattern or a string in a file?

how to remove string in multiple file name after a specific character?

How to remove everything after specific character in string using Java

How to remove all the letters from a string after a specific point in R?

How to remove text from a string after a specific character?

how to capture string from csv line that comes after specific word

How to return the remaining a line in a file after a specific string

Remove specific string after specific words in python

Remove all lines after a specific line in Python

Python - remove specific line in string variable