- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how can I identify files that contain controlM...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2009 12:58 PM
тАО02-20-2009 12:58 PM
-rwxr-xr-x 1 root sys 6311 Feb 20 12:35 asciiFILE.sql
found a tr command, which easily removes these unwanted controlM characters
# cat asciiFILE.sql | tr -d '\015' > nonasciifile.sql
-rw-r--r-- 1 root sys 6097 Feb 20 12:36 nonasciiFILE.sql
rather then perform this tr command on every single sql file on my box...is there a way to identify which files contain the controlM characters?
file didn't work:
# file asciiFILE.sql
asciiFILE.sql: ascii text
# file nonasciiFILE.sql
nonasciiFILE.sql: ascii text
any assistance is appreciated.
manuel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2009 12:59 PM
тАО02-20-2009 12:59 PM
Re: how can I identify files that contain controlMs on my box...
^M
--alter session set sql_trace = true ; ^M
^M
^M
declare ^M
^M
-- cursor to loop thru all the valid lockboxes ^M
^M
cursor lock_cur is ^M
select lockbox_number ^M
from ar_lockboxes_all ^M
where status = 'A' ; ^M
^M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2009 01:05 PM
тАО02-20-2009 01:05 PM
Re: how can I identify files that contain controlMs on my box...
This results from moving a Windows-based file to your Unix server via FTP in BINARY mode instead of ASCII mode (which handles the conversion automatically). Windows denotes end-of-lines with a linefeed+carriage-return whereas Unix uses a simple linefeed.
On HP-UX simply use:
# dos2ux file > file.new
Inversely, to ADD a carriage-return do:
# ux2dos file > file.new
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2009 01:07 PM
тАО02-20-2009 01:07 PM
Re: how can I identify files that contain controlMs on my box...
Also this issue might occur if you have transferred the file in ASCII format instead of Binary format.
Try
# grep '^M' /
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2009 01:11 PM
тАО02-20-2009 01:11 PM
Solution> rather then perform this tr command on every single sql file on my box...is there a way to identify which files contain the controlM characters?
Yes, you could use:
# perl -nle 'print "CR Present!" and exit if m{\r}' file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2009 01:17 PM
тАО02-20-2009 01:17 PM
Re: how can I identify files that contain controlMs on my box...
CR Present!
> perl -nle 'print "CR Present!" and exit if m{\r}' nonasciiFILE.sql
thanks James, just what I was looking for...
happy friday everyone :)