2016年6月15日水曜日

how to eliminate blank lines by atom regex.

​use "^\s" instead of traditonal "^$". seems that atom's regex works only ​​when at least one character is being consumed.

When given data are below,

[2016-06-01,167],[2016-06-02,155],[2016-06-03,140],[2016-06-04,138],[2016-06-05,144],[2016-06-06,176],[2016-06-07,157],[2016-06-08,146],[2016-06-09,134],[2016-06-10,130],[2016-06-11,119],[2016-06-12,107],[2016-06-13,141]]

regex below will remove all brackets and leave data and just one comma before them. DO NOT FORGET BRACES!

\[+[0-9-]+,([0-9]+)\][,\]]  →  $1,

when original data is as below

423 258 314 175 255 211 134 162 205 168 156 273 258 288 291 243 128

(\b[0-9]*\b) → $1,

wil add comma at the end of each numeric.

423, 258, 314, 175, 255, 211, 134, 162, 205, 168, 156, 273, 258, 288, 291, 243, 128,

77.9 73.5 74.5 72.2 73.1 73.4 72.9 72.7 76.9 73.1 71.8 79 79.9 78.4 77.4 79.6 74.6

(\s) → ,   # actually ", + space"

77.9, 73.5, 74.5, 72.2, 73.1, 73.4, 72.9, 72.7, 76.9, 73.1, 71.8, 79, 79.9, 78.4, 77.4, 79.6, 74.6


0 件のコメント: