Hi,
Looks you are trying to convert Google Data to Metastock.
if you are doing this for Intraday, I think your this try will not last much longer as there will be many other problems that you will face.
If you are trying for EOD data and you are doing it for NSE/BSE/NSEFO data you can either try
Getbhavopy.com
or
There are free utilities to provide data to be in Metastock Import Format.
Thanks & Regards
Vikas Parikh