Google Answers Logo
View Question
 
Q: Extract text from documents using asp.net ( No Answer,   1 Comment )
Question  
Subject: Extract text from documents using asp.net
Category: Computers > Programming
Asked by: sapex-ga
List Price: $10.00
Posted: 14 Oct 2005 23:48 PDT
Expires: 13 Nov 2005 22:48 PST
Question ID: 580540
Objective : I need to use IIS and Indexing service to extract text out
of documents (mostly office docs, html, rtf, etc which are by default
supported by indexing service)


Tools : Solution should be using asp.net

Don'ts : Please do not use any third party or office  filter solution.
Office is not supposed to be installed on server.

Expected : Lead me to a sample code which does this
Answer  
There is no answer at this time.

Comments  
Subject: Re: Extract text from documents using asp.net
From: jstar-ga on 02 Nov 2005 00:05 PST
 
using System;
using System.IO;

public void test()
{
StreamReader sr;
string inputFile="file1.doc";
string outFile ="file2.doc";
try
 {
  sr = new StreamReader(inputFile);				
  StreamWriter sw = new StreamWriter(outFile);
  String line;
  while ((line = sr.ReadLine()) != null) 
 {
   // if you need to filter, just check the line for its context
   sw.WriteLine(line); 
 }
sr.Close();
sw.Flush();
sw.Close();
}
catch (Exception e){Console.WriteLine(e.Message + ", " + e.StackTrace);}
}

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy