Home > Mobile >  Regex / Notepad Newbie Question: How to Delete A Portion of Each Line
Regex / Notepad Newbie Question: How to Delete A Portion of Each Line

Time:04-18

I know very little about regex or Notepad , but I am hoping this is the right place to ask for help. I am dealing with a .txt file with about a 1000 lines. Each line looks like

\newlabel{name}{{number}{another number}{part I do not want}{another part I do not want}{}}

but I want

\newlabel{name}{{number}{another number}}

For example, I would like

\newlabel{inf-just}{{905}{762}{\hspace *{.1in}Infinity}{meti.905}{}}
\newlabel{n-ary-op}{{877}{741}{Numerical Operations}{meti.877}{}}

to become

\newlabel{inf-just}{{905}{762}}
\newlabel{n-ary-op}{{877}{741}}

I am completely out of my depth, so I would greatly appreciate advice for how to do this. Thank you in advance!

CodePudding user response:

Well for your given sample, this code came in idea.

Find:^(\\.*?\d }{\d }).*
Replace all:$1}

  • Related