- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Help required with a script or file filter
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
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
тАО06-09-2004 07:41 AM
тАО06-09-2004 07:41 AM
I have an output file that I need to re-format. Unfortunately, one of our tools - which can not be re-written or modified, outputs a file in this format.
CACAATGAGAAATACCTGGTGGTGCTCAGCTCA
CTCAGATTGTTCCACATATTCTAGAATAAATAA
ACGAAAGTCTAAAGTACTAAGTTTAGGCAATAC
TCTCTCTCAAGGGCTTCAGCAGGCCCCCAACCT
TACTCAAAGTATAGCAGGATAGTATATTTCAAA
and so on.
However, we want to remove the formatting or the right carriage return at the end of each line so that the output would look like this:
CACAATGAGAAATACCTGGTGGTGCTCAGCTCACTCAGATTGTTCCACATATTCTAGAATAAATAAACGAAAGTCTAAAGTACTAAGTTTAGGCAATACTCTCTCTCAAGGGCTTCAGCAGGCCCCCAACCTTACTCAAAGTATAGCAGGATAGTATATTTCAAA
Any ideas/suggestions?
This is running on Redhat 9.0.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2004 08:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2004 12:11 PM
тАО06-09-2004 12:11 PM
Re: Help required with a script or file filter
tr -d "\n" < file > newfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2004 03:09 PM
тАО06-09-2004 03:09 PM
Re: Help required with a script or file filter
perl -pe 'chop' < file > newfile
-p = implicit read loop and print $_ at end
-e = immediate command line
'chop' = the entire program :-). Takes last character from line which is the \n
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2004 04:02 PM
тАО06-09-2004 04:02 PM
Re: Help required with a script or file filter
cat file |tr "\n" " " |sed "s/\ //g"
Regds,
Kaps