Commit f7ba686f authored by Sergey Konovalov's avatar Sergey Konovalov

TestDocsWithChart

parent c41385e1
......@@ -45,7 +45,8 @@ namespace TestDocsWithChart
{
static void Main(string[] args)
{
getFilesPivot();
getFilesConditional();
//getFilesPivot();
//getFilesAlternateContent();
//getFiles();
//convertFiles();
......@@ -74,6 +75,45 @@ namespace TestDocsWithChart
}
}
static void getFilesConditional()
{
//string sFindText = "conditionalFormatting";
//string sDirInput = @"\\192.168.3.208\allusers\Files\XLSX";
//string sDirOutput = @"D:\Files\Conditional";
string sFindText = "type=\"expression\"";
string sDirInput = @"D:\Files\Conditional";
string sDirOutput = @"D:\Files\ConditionalFormulaExpression";
String[] allfiles = System.IO.Directory.GetFiles(sDirInput, "*.*", System.IO.SearchOption.AllDirectories);
for (var i = 0; i < allfiles.Length; ++i)
{
string file = allfiles[i];
try
{
ZipArchive zip = ZipFile.OpenRead(file);
string sOutputPath = Path.Combine(sDirOutput, Path.GetFileName(file));
foreach (ZipArchiveEntry entry in zip.Entries)
{
if (entry.FullName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase))
{
using (StreamReader reader = new StreamReader(entry.Open(), Encoding.UTF8))
{
string sXml = reader.ReadToEnd();
if (-1 != sXml.IndexOf(sFindText))
{
System.IO.File.Copy(file, sOutputPath, true);
}
}
}
}
}
catch (Exception e)
{
}
}
}
static void getFilesAlternateContent()
{
string sAlternateContent = ":Choice ";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment