-3

I iam trying to convert my data from this form e.x 12hju 1002 to ,("1002") and ,("12hju"). How can i suround my data with this ,("") between "" is my data .

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563

3 Answers3

0

You can replace all the , with "),(" and then add the (" in the beginning and ") at the end manually.

Amita
  • 944
  • 1
  • 8
  • 20
0

A regex as ([\d\w]+),([\d]+) and replace with ,\("\2"\),\("\1"\) will do exactly what you want for your single data entry.

You'll likely need to tune the regex to the entire set.

SaeX
  • 17,240
  • 16
  • 77
  • 97
0
  • CtrlH
  • Find what: ^(\S+),(\S+)
  • Replace with: \("$2"\),\("$1"\)
  • Replace all

Explanation:

^               : start of string
  (\S)          : group 1, 1 or more non space
  \s            : a space
  (\S)          : group 2, 1 or more non space

Note: with Npp, the parenthesis have to be escaped in the replacement.

Toto
  • 89,455
  • 62
  • 89
  • 125