regex - Notepad++ CSV splitting and removing fields -
i have collection of data in csv file , want manipulate in use of values in it. example have:
1,2,3,4,5,6 asd,sdf,dfg,fgh,ghj,hjk asd,sdf,dfg,fgh,ghj,hjk asd,sdf,dfg,fgh,ghj,hjk asd,sdf,dfg,fgh,ghj,hjk asd,sdf,dfg,fgh,ghj,hjk
what want use use few fields , possibly in different order
1,4,3
i know notepad++ can break values , rearrange them using \1,\2,ect don't know how this.
this regular expression match 6 groups of 0+ non-comma characters each line:
^([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)$
you can replace captured groups so:
\1,\4,\3
side note:
someone correct me if i'm wrong. i've been trying reduce down 1 repeated capturing group legibility, can't seem make work since sees 1 capture group:
^([^,]*,?){6}$
Comments
Post a Comment