upload files and count number of words

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tim knox
    New Member
    • Jul 2007
    • 2

    upload files and count number of words

    can someone help me!

    i am using ASP Upload to upload files to my server. Does anyone know how I could automatically work out the number of words in each file? The files could be a .doc, .xls, .txt or .pdf
  • abehm
    New Member
    • May 2007
    • 35

    #2
    you could read the file to a string and try using the split method.


    string filestring = File.ReadAllTex t(filepath);
    string[] word = filestring.Spli t(' ');

    int wordcount = word.Length;

    Comment

    • tim knox
      New Member
      • Jul 2007
      • 2

      #3
      thanks for that........

      i am still having a problem with reading the file! my code is:

      <%
      Dim strInputText
      Dim file
      Dim ReadAllText
      strInputText =
      file.ReadAllTex t("d:\inetpub\l anguage-xchange.co.uk\w eb\ASPTOC.doc")
      Response.Write "You entered:<br />" & vbCrLf
      Response.Write strInputText
      %>

      any ideas what is wrong?

      Comment

      Working...