Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 129
  • Last Modified:

I have a large text file, I need to trim every line that begins with a certain string down to 72 characters.

I have been playing with regex but havent had any luck.  Any ideas?
0
dblameuser
Asked:
dblameuser
  • 2
  • 2
1 Solution
 
käµfm³d 👽Commented:
What language or text editor are you using to accomplish this? Also, how long is the "certain string"?
0
 
dblameuserAuthor Commented:
I am using notepad ++, the string is only 5 characters long.
So every line that begins with <213> I need to trim to 72 characters.
0
 
käµfm³d 👽Commented:
Try:

Find
^(<213>.{67}).*$

Open in new window


Replace
$1

Open in new window


If your version of N++ has it, make sure ". matches newline" is unchecked.
0
 
dblameuserAuthor Commented:
That did the trick!  Thank you!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now