- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Add return feed.
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
тАО08-09-2002 06:49 AM
тАО08-09-2002 06:49 AM
I get these files from NT world. When i open them with vi, i get the message "Incomplete Last line". Also each line has ^M characters except the last line. I am tryin to use sed to strip the ^M characters (cat $file | sed 's/^V^M//g' > $file.new) but this deletes the last line too.
So i am trying to figure out some way to add a return feed to just the last line before running the sed part.
I assume this will retain the last line after running the sed part.
Any help is greatly appreciated.
TIA.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 06:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 06:51 AM
тАО08-09-2002 06:51 AM
Re: Add return feed.
dos2ux filename > filename.ux
similarly
ux2dos filename.ux > filename.winders
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 06:54 AM
тАО08-09-2002 06:54 AM
Re: Add return feed.
Plan B. If you are transferring these files via FTP, use the ascii command prior to the put or get and the conversion will be automatic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 06:56 AM
тАО08-09-2002 06:56 AM
Re: Add return feed.
Coupe of ways to do it
dos2ux filename > newfileanem
will get rid of the ^M
also
cat filename | sed -e "1,$s/\^M//g" should do the trick
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 07:09 AM
тАО08-09-2002 07:09 AM
Re: Add return feed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 07:15 AM
тАО08-09-2002 07:15 AM
Re: Add return feed.
cat
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 07:19 AM
тАО08-09-2002 07:19 AM
Re: Add return feed.
look at this thread
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xd6f956bd90a9d611abdb0090277a778c,00.html
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 07:30 AM
тАО08-09-2002 07:30 AM
Re: Add return feed.
N/A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2002 07:50 AM
тАО08-09-2002 07:50 AM
Re: Add return feed.
To go back to the problem...
Oops, My mistake!(So full marks to everyone) I forgot to mention that i have already tried the dos2unix option. It removes the ^M fine but the subsequent job which uses the file fails.
So i manually added a return to the end of the last line and it works fine.
So it appears that i need to find a way to get a return feed at the end of the last line only.
Any help??
TIA.
I have attached a sample file.