- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- Perl text formating help
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- Report Inappropriate Content
10-18-2004 10:37 AM
10-18-2004 10:37 AM
I have a bunch of text files that are messed up when I open them up in word. Is there a way in perl to format the txt file so that it appears in word correctly. Please see the attahed file in MS word to see that the formating of the txt file is messed up.
Below is a part of the file and you can see that the carriage returns are the problem.
Is there a way to fix this?
Thanks For the help.
Dear Mr.,
Mercury pollution from power plants poses a serious threat to pregnant
women,
fetuses, and children. It causes learning disabilities and other
neurological
disorders.
The Clean Air Act requires the EPA to set limits on hazardous power-plant
pollution
such as mercury, taking into account the maximum reductions that are
achievable
using current technology. The EPA said it could require a 90% reduction in
mercury
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2004 01:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2004 01:21 PM
10-18-2004 01:21 PM
Re: Perl text formating help
Does the new formated version get saved as the same file name? I ran the command fmt 98788.txt and opened the file in MS word after word. The text is still the same as before. With this command should the document come up in word correctly?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2004 01:31 PM
10-18-2004 01:31 PM
Re: Perl text formating help
fmt 161950.txt >161950.new.txt
or something like that. If you want to replace the original file with the new one, you'll have to rename it (after making sure the new file is what you want)
mv 161950.new.txt 161950.txt
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2004 02:00 PM
10-18-2004 02:00 PM
Re: Perl text formating help
You are a life saver. I have one more question. How could I run the command for a bunch of files at once where the files will be formated and saved?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-18-2004 02:03 PM
10-18-2004 02:03 PM
Re: Perl text formating help
for f in *.txt
do
fmt $f >${f}.new
mv $f.new $f
done
Replace the '*.txt' with whatever filespec that matches the files you need to work on.
Have fun!
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-21-2004 03:30 AM
10-21-2004 03:30 AM
Re: Perl text formating help
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP