delimiter - Ways to delimit your text in VBSCRIPT -


i have file following inputs

"smegold 1312",20131127,"c","11606233e","smx","c",20131009,170028,"smx","70207",0,1,4699,0,469.9,"usd",0,"",0,"",0,"",0,"",0,0,0,8062696,"",0,20131009,170028,"system","25228","","166","121328200000223",785,0,"","","","","","","","","","","","",0,0,0,"",20131009,170028,"advmee"

"smegold 1312",20131127,"c","11606233e","smx","c",20131009,170030,"smx","70207",0,1,4699,0,469.9,"usd",0,"",0,"",0,"",0,"",0,0,0,8062697,"",0,20131009,170031,"system","25228","","167","121328200000223",786,0,"","","","","","","","","","","","",0,0,0,"",20131009,170028,"advmee"

what achieve obtain first quote text of line. example "smegold 1312". append first 3 characters , last 4 characters of extracted text of line.

and move next line carry on procedure till end of file.

any advise great help. tried using objregex.pattern no avail

thanks

use pattern cuts/groups first field in toto (1), first 3 (2) , last 4 (3) characters, , rest (4). .replace creatively:

>> s = replace("'smegold 1312','whatever','advmee'", "'", """") >> wscript.echo s >> set r = new regexp >> r.pattern = "^((""[^""]{3})[^""]*?([^""]{4}""))(.*)" >> wscript.echo r.replace(s,"$1$4,$2$3") >> "smegold 1312","whatever","advmee" "smegold 1312","whatever","advmee","sme1312" 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -