It took sometime to me to understand the powerful concept, i.e, REGEX. Below is the REGEX expression to parse the CSV log files, which have been generated by PostgreSQL. Regex is :- -=-=-=-=-= "^((([^, \"\n\r ]*)|( \" ([^ \" ]|( \"\" ))* \" )),){22}( \" ([^ \" ]|( \"\" ))* \" [ \r\n ]+)" Use any regex tools like RegexBuddy, which will give you detailed information about this regular expression. Dinesh Kumar