Mark
Mark

Reputation: 1569

Find and replace first comma in line with space

Find and replace first comma in line with a space, for all lines in a file, and for all files in a directory. Windows based solutions only please, I don't have sed etc. I have notepad++ o a regex would be good.

Upvotes: 0

Views: 2886

Answers (1)

Skurmedel
Skurmedel

Reputation: 22149

Get all non-comma characters before a comma into group 1. Match a comma. Get all the characters to line end/end of input into group 2.

^([^,]*),(.*)$

Replace with group 1 + " " + group 2.

\1 \2

Or...

  1. Download sed.
  2. Run it with sed 's/,/ /' blah1 > blah2
  3. ???
  4. Profit

Upvotes: 3

Related Questions