-1

I would like to replace empty cells with NA in Notepad ++ The empty cells are not showing here, but I would like to fill in the empty spaces with NA.

Sample data set:

15876346,71F,70152731459,H,2.3,6,14,31

18334617,82F,7015273698,C,1.2, , ,21

42190557,01F,7015273,C, , ,21,57

Desired output:

15876346,71F,70152731459,H,2.3,6,14,31

18334617,82F,7015273698,C,1.2,NA ,NA ,21

42190557,01F,7015273,C,NA ,NA,21,57

El.h
  • 31
  • 7

1 Answers1

0
  • Ctrl+H
  • Find what: (?<=,)\h*(?=,)
  • Replace with: NA
  • CHECK Match case
  • CHECK Wrap around
  • CHECK Regular expression
  • UNCHECK . matches newline
  • Replace all

Explanation:

(?<=,)      # positive lookbehind, make sure we have a comma before
\h*         # 0 or more horizontal spaces
(?=,)       # positive lookahead, make sure we have a comma after

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here

Toto
  • 89,455
  • 62
  • 89
  • 125