- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Perl text formating help
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
тАО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
- Report Inappropriate Content
тАО10-18-2004 01:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- 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
- 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
- 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
- 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
- Report Inappropriate Content
тАО10-21-2004 03:30 AM
тАО10-21-2004 03:30 AM