mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
.
This commit is contained in:
@ -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 ";
|
||||
|
||||
Reference in New Issue
Block a user