Convert word document to text file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sangith
    New Member
    • Jun 2007
    • 25

    Convert word document to text file?

    Hi,
    How do I convert a word document into a text file. (For eg: If I give input as file1.doc, my Perl program should automatically convert it into file1.txt)
    Is there any Perl module which does this conversion?

    I would appreciate your response!

    Thanks in advance!
    Sangith
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Are you referring to MS Word or Windows Wordpad? There are no perl modules for Wordpad (.doc) but there are plenty on CPAN for Word.

    Comment

    • sangith
      New Member
      • Jun 2007
      • 25

      #3
      Originally posted by KevinADC
      Are you referring to MS Word or Windows Wordpad? There are no perl modules for Wordpad (.doc) but there are plenty on CPAN for Word.

      Hi Kevin,

      I am referring to MS-Word document.

      Thanks,
      Sangith

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Originally posted by sangith
        Hi Kevin,

        I am referring to MS-Word document.

        Thanks,
        Sangith
        Per Kevin's posting, go out to CPAN and search for word. Then, check all of the modules returned to see if any of them will do what you want. You have to research what you want to do before throwing your arms up and asking someone else.

        Regards,

        Jeff

        Comment

        • rellaboyina
          New Member
          • Jan 2007
          • 55

          #5
          Originally posted by numberwhun
          Per Kevin's posting, go out to CPAN and search for word. Then, check all of the modules returned to see if any of them will do what you want. You have to research what you want to do before throwing your arms up and asking someone else.

          Regards,

          Jeff
          You can use Perl's rename() method for renaming a file as
          rename(sourcefi le, destfile)

          Comment

          • numberwhun
            Recognized Expert Moderator Specialist
            • May 2007
            • 3467

            #6
            Originally posted by rellaboyina
            You can use Perl's rename() method for renaming a file as
            rename(sourcefi le, destfile)
            That would certainly rename the files, but renaming a file does not convert the format from one to another. A word document, by any other name is still a word document, unless of course you remove all of the formatting through conversion.

            Regards,

            Jeff

            Comment

            Working...