user2782184
user2782184

Reputation: 71

Keep only the first 8 characters in a line in notepad++

I'm having troubles on keeping the first 8 characters in Notepad++.

I have a list like this :

johndoe2.21test
markdoetesting.new
marvin213.jo.hn
abcd1234.dcba

And I want a output like this:

johndoe2
markdoet
marvin21
abcd1234

Can you point me in the right direction ?

Upvotes: 7

Views: 18878

Answers (1)

Noel
Noel

Reputation: 10525

You could use the column select feature for this.

  • Use Alt + Shift + Arrow keys to select only the first eight characters.
  • Once you select, copy it and paste it elsewhere.

You can also use Find and Replace in Regular Expression mode.

  • Use Find/Replace feature.
  • Select Regex Search Mode.
  • In Find box enter this ^(.{8}).*
  • In Replace box enter this \1
  • Click on Replace All.

Upvotes: 14

Related Questions