vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| My own problem is not removing these characters from the unload file, but removing them from the table before I do the unload. Any ideas ? Dirk -----Original Message----- From: Dirk Moolman Sent: 04 August 2006 01:27 PM To: 'Prateek Jain'; informix-list@iiug.org Subject: RE: ^M character This one should be easy. You can do this in a for-loop, and then use sed to do your search and replace for you. Or there is also a unix2dos command that can do this for you. One example, creating a new clean file, and overwriting the original one with the new file: For i in `find . -type f -print` Sed 's/^M//g' $i > /tmp/fixfile ##(where ^M is created by typing <ctrl-v><ctrl-m>) Mv /tmp/fixfile $i End for Or replace the sed command with a unix2dos command These are just simple example to give you an idea of how it could be done. ________________________________________ From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of Prateek Jain Sent: 04 August 2006 12:40 PM To: informix-list@iiug.org Subject: ^M character Hi guys, I have got files in directory and all the files have got ^M is there any way to replace all the ^M character in all the file recursively. -- Regards, Prateek Jain > The information on this e-mail including any attachments relates to the official business of DigiCare (Pty) Ltd. The information is confidential and legally privileged and is intended solely for the addressee. Access to this e-mail by anyone else is unauthorised and as such any disclosure, copying, distribution or any action taken or omitted in reliance on it is unlawful. Please notify the sender immediately if it has inadvertently reached you and do not read, disclose or use the content in any way. > No responsibility whatsoever is accepted by DigiCare (Pty) Ltd if the information is, for whatever reason, corrupted or does not reach its intended destination. The views expressed in this e-mail are the views of the individual sender and should in no way be construed as the views of DigiCare (Pty)Ltd, except where the sender has specifically stated them to be the views of DigiCare (Pty) Ltd. > http://196.33.167.71/digicare |
| ||||
| Assuming you are on 9+ then install the regexp bladelet then something along the lines of Update table Set col = regexp_replace(col,"^M","") Where 1=1 Should work Paul Watson Tel: +44 1414161772 Mob: +44 7818003457 Web: www.oninit.com GO FURTHER with DB2 GET THERE FASTER with Informix. Attend the IDUG 2006 European Conference. Vienna, Austria. 2-6 October 2006 Visit http://www.iiug.org/conf for more information. -----Original Message----- From: Dirk Moolman [mailto Posted At: 04 August 2006 06:28 Posted To: comp.databases.informix Conversation: ^M character Subject: RE: ^M character My own problem is not removing these characters from the unload file, but removing them from the table before I do the unload. Any ideas ? Dirk -----Original Message----- From: Dirk Moolman Sent: 04 August 2006 01:27 PM To: 'Prateek Jain'; informix-list@iiug.org Subject: RE: ^M character This one should be easy. You can do this in a for-loop, and then use sed to do your search and replace for you. Or there is also a unix2dos command that can do this for you. One example, creating a new clean file, and overwriting the original one with the new file: For i in `find . -type f -print` Sed 's/^M//g' $i > /tmp/fixfile ##(where ^M is created by typing <ctrl-v><ctrl-m>) Mv /tmp/fixfile $i End for Or replace the sed command with a unix2dos command These are just simple example to give you an idea of how it could be done. ________________________________________ From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of Prateek Jain Sent: 04 August 2006 12:40 PM To: informix-list@iiug.org Subject: ^M character Hi guys, I have got files in directory and all the files have got ^M is there any way to replace all the ^M character in all the file recursively. -- Regards, Prateek Jain > The information on this e-mail including any attachments relates to the official business of DigiCare (Pty) Ltd. The information is confidential and legally privileged and is intended solely for the addressee. Access to this e-mail by anyone else is unauthorised and as such any disclosure, copying, distribution or any action taken or omitted in reliance on it is unlawful. Please notify the sender immediately if it has inadvertently reached you and do not read, disclose or use the content in any way. > No responsibility whatsoever is accepted by DigiCare (Pty) Ltd if the information is, for whatever reason, corrupted or does not reach its intended destination. The views expressed in this e-mail are the views of the individual sender and should in no way be construed as the views of DigiCare (Pty) Ltd, except where the sender has specifically stated them to be the views of DigiCare (Pty) Ltd. > http://196.33.167.71/digicare |