Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Number of lines and characters

by CubicSpline (Friar)
on Aug 28, 2002 at 15:19 UTC ( [id://193482]=note: print w/replies, xml ) Need Help??


in reply to Number of lines and characters

Before you try this out, you may actually want to look at what a Word .doc file actually looks like in a plain old text viewer. There's a lot of junk in there you don't want to count.

I'd suggest saving your .doc file off as text first, if you really want to do this through perl.

Once you've got just the text you want to count, you can do what you want in several ways. Here are my contributions:

open FILE, "<$file"; my @lines = <FILE>; print "Lines: " . scalar(@lines) . "\n"; print "Chars: " . length(join '', @lines) . "\n"; close FILE;

~CubicSpline
"No one tosses a Dwarf!"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://193482]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found