Hi all, We are trying to read a word file using perl... All the contents of a word file is read except the bullet character .. Can anyone hep us to get the bullets while reading a word file? We are getting the content of the bullets but we need the bullets also.
The code that we tries as follows: use strict; #use Text::Wrap; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; use Win32::OLE::Enum; die "Usage: perl doc_print.pl test.doc" unless @ARGV == 1; my $File = $ARGV[0]; $File = Win32::GetCwd() . "/$File" if $File !~ /^(\w:)?[\/\\]/; die "File $ARGV[0] does not exist" unless -f $File; my $Word = Win32::OLE->new('Word.Application', 'Quit') or die "Couldn't run Word"; my $Doc = $Word->Documents->Open($File); my (@words, $nwords, @chars, $nchars, $len, $object, $paragraph, $paragraph_count, $enum, $allText, $para_temp); my $lc = 0; my $pc = 0; my (@char, $char); $enum = Win32::OLE::Enum->new($Doc->Paragraphs); $allText = ''; $para_temp = 0; while(($object = $enum->Next)) { $para_temp++; $paragraph = $object->Range->{Text}; $allText .= $paragraph; chop $paragraph; unless ($paragraph eq '') { $paragraph_count++; } chomp $paragraph; @words = split /\s+/, $paragraph; $nwords += @words; @chars = split //, $paragraph; $nchars += @chars; } $allText =~ tr/\t //d; $len = length($allText) - $para_temp; printf "Pages %d\n", $pc; printf "Words %d\n", $nwords; printf "Character (No spaces) %d\n", $len; printf "Character (with spaces) %d\n", $nchars; printf "Paragraphs %d\n",$paragraph_count; printf "Lines %d\n", $lc; $Doc->Close; print "\n-->$allText\n"; Thanks, Anu.