How do I write a regex in Notepad++ to search and replace all whitespaces (up to a certain point) with a comma?
Original Text
468620438 [2012-07-07 00:00:00,307] [Thread-20] INFO BIZ,Handler,getJobs():Retrieving messages from A...
468620438 [2012-07-07 00:00:00,307] [Thread-20] INFO BIZ,InterfaceAdaptor,getMessages : Retrieving messages from B
468620453 [2012-07-07 00:00:00,322] [Thread-20] INFO BIZ,Handler,_getNextMessage():Retrieving messages from B
Amended Text
468620438,[2012-07-07 00:00:00,307],[Thread-20],INFO,BIZ,Handler,getJobs():Retrieving messages from A...
468620438,[2012-07-07 00:00:00,307],[Thread-20],INFO,BIZ,InterfaceAdaptor,getMessages : Retrieving messages from B
468620453,[2012-07-07 00:00:00,322],[Thread-20],INFO,BIZ,Handler,_getNextMessage():Retrieving messages from B
The easiest way would be to spell out exactly what you want replaced:
Replace
by
This is easiest because you’re complicating things by needing to include knowledge how the fields look like, e.g. the second column includes a space that should not be replaced.