TickWrite 7 will do PRECISELY this for you, but it only imports their data format (.tdi). Specify any tick, trade, time, daily, weekly, monthly bar you wish. You then manually select your columns of choice (date, time, open, close, high, low, vol, ...) and it will spit it out to ASCII...