Hi All,
I have a text file containing two fields, the first field holds the website name and the second one holds the rest of the URL (Request part). My requirement is to split the request part based on the characters "=" and "&". The process should also consider the URL escape characters, for example if the URL contains any of the escape code listed below it should be replaced with the corresponding character. A sample is shown below:
========================================================
INPUT (Data in the text file, can contain 1 million rows)
=========================================================
www.testwebsite.com;I_CMDTypeOrig=&I_OrderReceiptTime=10%3A35%3A10&verifySO=Y&I_Acc=ABC373&loadEvaluated=false&I_OrderReceiptDate=09%2F02%2F2009&I_SecId=JED&
========================================================
OUTPUT
Note in the below output %3A has been replaced by ":" and %2F with "/"
========================================================
WEBISTENAME;KEY;VALUE
www.testwebsite.com; I_CMDTypeOrig;NULL
www.testwebsite.com; I_OrderReceiptTime;10:35:10
www.testwebsite.com; verifySO;Y
www.testwebsite.com; I_Acc ;ABC373
www.testwebsite.com; loadEvaluated;false
www.testwebsite.com; I_OrderReceiptDate;09/02/2009
www.testwebsite.com; I_SecId;JED
========================================================
URL Escape Characters
========================================================
Character Escape Code
SPACE => %20
[ => %5B
< => %3C
] => %5D
> => %3E
` => %60
# => %23
; => %3B
% => %25
/ => %2F
{ => %7B
? => %3F
} => %7D
: => %3A
| => %7C
@ => %40
\ => %5C
= => %3D
^ => %5E
& => %26
~ => %7E
$ => %24
========================================================
Any pointers to arrive at the above output will be greatly appreciated.
Thanks in advance.
~John