stripping HEX code out of a string
Posted on 2005-05-10
Got a need to strip out trailing HEX code '0a0d ' from the end of a string orders.notes. orders.notes is a text field and contains lots of trailing carage returns and line feeds. I do need to preserve the Carrage returns and line feed that are within the text.
THis file and fields are fixed LENGTH
I would like the orders.notes to be 255 chars in lenghth padded with trailing spaces or 0 but not hex.
$query_rsOrders = "SELECT CONCAT( LPAD(orders.orderid, 11, '0' ), RPAD(orders.notes,225, ' '), RPAD(orders.company, 100, '0')) FROM orders,
order_details WHERE orders.orderid = order_details.orderid ORDER BY orders.orderid INTO OUTFILE '/home/WEB/ORDERTXT' FIELDS TERMINATED BY '' LINES TERMINATED BY '' ";
Thanks in advance.