[X-Unix] text file parsing?
Kuestner, Bjoern
Bjoern.Kuestner at drkw.com
Wed May 3 08:19:28 PDT 2006
Use the "strings" command in your script to remove binary data.
Use "tail" and "head" commands to work trim from or to the end or beginning.
If it is indeed UTF-8 (or any other encoding) use textutil to change the
encoding (or even the format) as you like. (Only available on OS X, so this
would make your script non-portable to other Unixish OSes.
Use sed or awk for other text manipulations. Just get back to this list with
specific questions, because sed and even more so awk can be tricky. Of
course you can also ask about the other commands if the man pages don't help
you much (which I sometimes find the case for me.)
Björn
--------------------------------------------------------------------------------
The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender.
--------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.themacintoshguy.com/pipermail/x-unix/attachments/20060503/d8e844f7/attachment.html
More information about the X-Unix
mailing list