On 7/16/20 at 5:01 AM, [email protected] ('anotherhoward' via BBEdit Talk) wrote:

how can I remove everything after 'NYM,,,,,' which ends with a
carriage return?
Note: Rows 1-3 below have the problem. Rows 4-5 do not.

1,Tom Seaver\seaveto01,60,Ind. Games,42,10,.808,1.42,60,42,17,0,533.0,308,90
,84,31,113,699,0.79,18,12,18.0,,,NYM,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Do the lines always have nothing but empty columns after the 'NYM' - i.e., nothing but commas? If so, you have some lines that are only commas.

Find lines with nothing but commas:
^,+\n

Replace with nothing.

Interpretation:

^       start of line
,+      one or more commas
\n      newline

If you wanted to also remove those extra commas after NYM:

Find
(NYM),+\n(,+\n)?

Replace with:
\1\n

(NYM)   Find NYM and capture it via parens
,+      One or more commas
\n      newline
(,+\n)? same pattern as first example, surrounded by parens and followed by '?' to mean zero or one of that sub-pattern

Replacement:

\1      \1 stands for the first capture (NYM)
\n      a newline right after NYM to replace the first newline

HTH
--

  - Bruce

_bruce__van_allen__santa_cruz__ca_

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "[email protected]" rather than posting here. 
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/r480Ps-10146i-A97B571EEEAB471AA3239E4EC86AE8EC%40Forest.local.

Reply via email to