If you want to delete all the text after a character or string (to the right) in Notepad++ you would need to make use of regex.
Let's say I have the text below which has a colon at each line and I do not want any text after the char colon (:)
Text:1 - New York, New York: 8,336,817 8,175,133 8,008,278 7,322,564
2 - Los Angeles, California: 3,979,576 3,792,621 3,694,820 3,485,398
3 - Chicago, Illinois: 2,693,976 2,695,598 2,896,016 2,783,726
4 - Houston, Texas: 2,320,268 2,100,263 1,953,631 1,630,553
5 - Phoenix, Arizona: 1,680,992 1,445,632 1,321,045 983,403
6 - Philadelphia, Pennsylvania: 1,584,064 1,526,006 1,517,550 1,585,577
7 - San Antonio, Texas: 1,547,253 1,327,407 1,144,646 935,933
8 - San Diego, California: 1,423,851 1,307,402 1,223,400 1,110,549
9 - Dallas, Texas: 1,343,573 1,197,816 1,188,580 1,006,877
10 - San Jose, California: 1,021,795 945,942 894,943 782,248
11 - Austin, Texas: 978,908 790,390 656,562 465,622
12 - Jacksonville, Florida: 911,507 821,784 735,617 635,230
Press Ctrl + Shift + F to open Find window, move to Replace Tab, Find :.* and Replace With: (keep it blank), make sure to keep Search Mode as Regular Expression,
Output:1 - New York, New York
2 - Los Angeles, California
3 - Chicago, Illinois
4 - Houston, Texas
5 - Phoenix, Arizona
6 - Philadelphia, Pennsylvania
7 - San Antonio, Texas
8 - San Diego, California
9 - Dallas, Texas
10 - San Jose, California
11 - Austin, Texas
12 - Jacksonville, Florida
Delete all text after a character or string in Notepad++
So, simply add .* to delete all characters after the string or character on each that you want to delete from a line.
Related Questions:- To delete after character: (char).*
- To delete after string?: (your-string).*
- To delete after word? : (your-word).*
- To delete after space? : \s.*
- To delete after comma? : ,.*
- To delete after semi-colon? : ;.*
- To delete after pipe? : \|.*
More Posts related to NotepadPlusPlus,
- Notepad++ Editor alternatives for macOS
- How to add or remove bookmark on a line in Notepad++
- Notepad++ do not show CRLF characters
- Reduce the size of Tabs on Notepad++
- Delete blank lines in a file using Notepad++
- Fix: Notepad++ bottom status bar not visible
- Notepad++ Hex Editor
- How to show End of Line Characters in File using Notepad++
- [Tutorial] Write And Run Python Code In Notepad++ Editor
- How to install XML Tools Plugin Notepad++
- Customizing Notepad++ New Document Line Encoding: CR/LF/CR LF
- How to remove blank lines from a file using Notepad++
- Column Mode Editing in Notepad++
- Convert text to random case using Notepad++
- How to recover unsaved notepad file Windows 10
- How to delete all text after a character or string in Notepad++
- Setting up Cloud feature with Notepad++
- Install Notepad++ silently using Windows Powershell
- Using Document Map in Notepad++
- Enabling Notepad++ Dark Theme
- [Fix] Notepad++ tab not visible (hidden)
- Where are Notepad++ macros stored?
- Multiple line editing in Notepad++
- Alternatives for Notepad++ on Mac in 2021
- [Nopepad++] How to add text at end of each line
More Posts:
- Fix: bash: 127: command not found - Bash
- List of Eclipse versions and future releases (2022-06) - Eclipse
- How to convert an int to a string in Python - Python
- How to create volume in Docker using Command - Docker
- How to change Android Button Color using xml attribute and programatically using java - Android
- How to read a .mat (MATLAB) file in Python - Python
- How to install curl on Alpine Linux - Linux
- Get Desc of Table using Java JDBC - Java