TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anoop gs
NA
26
3.9k
C# code -Compare 2 list and export the difference in excel
Mar 17 2020 2:13 AM
I have twp pdfs.I want to compare it.For that i converts 2 pdf into 2 lists.I want to compare the 2 lists and export the difference as 2 columns in excel.Could you please help me to find the c# code for it?Please find the below incomplete code?
public static void CompareTwoPDF(string FirstPDF, string SecondPDF)
{
if (File.Exists(FirstPDF) && File.Exists(SecondPDF))
{
PdfReader reader = new PdfReader(SecondPDF);
for (int page = 1; page <= reader.NumberOfPages; page++)
{
ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
FirstFile += PdfTextExtractor.GetTextFromPage(reader, page, strategy);
}
PdfReader reader1 = new PdfReader(FirstPDF);
for (int page = 1; page <= reader.NumberOfPages; page++)
{
ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
SecondFile += PdfTextExtractor.GetTextFromPage(reader1, page, strategy);
}
}
else
{
Console.WriteLine("Files does not exist.");
}
List<string> File1diff;
List<string> File2diff;
IEnumerable<string> file1 = FirstFile.Trim().Split('\r', '\n');
IEnumerable<string> file2 = SecondFile.Trim().Split('\r', '\n');
File1diff = file1.ToList();
File2diff = file2.ToList();
}
}
}
}
Reply
Answers (
5
)
How to assign value to input field ?
JavaScript Dragand Drop to textbox button should get diabled