$ 0 0 It would be easier to export the QueryID, SqlTextInfo into a file; and then use grep/ awk in Unix to extract in the required format.