Esempio n. 1
0
        public static void MergeOdt(Docs docs, string outputfilepath)
        {
            List <string>       filepaths     = new List <string>(docs.GetList());
            TextDocument        temp          = new TextDocument(outputfilepath);
            List <TextDocument> textdocuments = ListToTextDocuments(filepaths);

            for (int i = 0; i < textdocuments.Count; i++)
            {
                IList <ITextContent> textContents = textdocuments[i].Body.Content;

                foreach (var content in textContents)
                {
                    temp.Body.Add(content);
                }
            }

            temp.Save(outputfilepath, true);
        }
Esempio n. 2
0
        public static void MergeTxt(Docs docs, string resultfilepath)
        {
            List <string> inputfilespaths = docs.GetList();
            StreamReader  sr;
            StreamWriter  sw;
            string        text = String.Empty;

            for (int i = 0; i < inputfilespaths.Count; i++)
            {
                sr   = File.OpenText(inputfilespaths[i]);
                text = String.Empty;
                text = sr.ReadToEnd();
                sw   = File.AppendText(resultfilepath);
                sw.WriteLine(text);
                sw.Close();
                Console.WriteLine(text);
            }
        }