diff --git a/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF.sln b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF.sln new file mode 100644 index 000000000..a244e325f --- /dev/null +++ b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF.sln @@ -0,0 +1,25 @@ +ο»Ώ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36915.13 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-text-file-to-RTF", "Convert-text-file-to-RTF\Convert-text-file-to-RTF.csproj", "{08914445-D70E-8019-2963-69684D576876}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {08914445-D70E-8019-2963-69684D576876}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08914445-D70E-8019-2963-69684D576876}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08914445-D70E-8019-2963-69684D576876}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08914445-D70E-8019-2963-69684D576876}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1C46E81E-D023-4600-8B6B-DAC8CF38E500} + EndGlobalSection +EndGlobal diff --git a/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Convert-text-file-to-RTF.csproj b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Convert-text-file-to-RTF.csproj new file mode 100644 index 000000000..7e0429e70 --- /dev/null +++ b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Convert-text-file-to-RTF.csproj @@ -0,0 +1,22 @@ + + + + Exe + net8.0 + Convert_text_file_to_RTF + + + + + + + + + Always + + + Always + + + + diff --git a/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Data/Template.txt b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Data/Template.txt new file mode 100644 index 000000000..5ef8cec66 --- /dev/null +++ b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Data/Template.txt @@ -0,0 +1,15 @@ +Northwind Database + +The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases. Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data.. + +It contains the following detailed information: +1. Suppliers/Vendors of Northwind – who supply to the company. +2. Customers of Northwind – who buy from Northwind +3. Employee details of Northwind traders – who work for Northwind +4. The product information – the products that Northwind trades in +5. The inventory details – the details of the inventory held by Northwind traders. +6. The shippers – details of the shippers who ship the products from the traders to the end-customers +7. PO transactions i.e Purchase Order transactions – details of the transactions taking place between vendors & the company. +8. Sales Order transaction – details of the transactions taking place between the customers & the company. +9. Inventory transactions – details of the transactions taking place in the inventory +10. Invoices – details of the invoice raised against the order. diff --git a/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Output/.gitkeep b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Output/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Output/Result.rtf b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Output/Result.rtf new file mode 100644 index 000000000..57a432ee0 --- /dev/null +++ b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Output/Result.rtf @@ -0,0 +1,42 @@ +{\rtf1\ansi{\fonttbl{\af0\fcharset0 Times New Roman;} +{\f1\fcharset0 Times New Roman;} +} +{\colortbl;} +{\*\defchp\rtlch\fcs1\lang1033\af0\afs24\ltrch\fcs0\lang1033\f1\fs24\lang1033\langfenp1028\langfe1025} +{\*\defpap\pard\plain\lang1033\widctlpar\ql\fi0\li0\ri0 +} +{\stylesheet{\s1\lang1033\widctlpar\ql\fi0\li0\ri0 +\rtlch\fcs1\lang1033\af0\afs24\ltrch\fcs0\lang1033\f1\fs24\lang1033\langfenp1028\langfe1025\sqformat Normal;}{\cs2\additive\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\sqformat Default Paragraph Font;}} +{\*\listoverridetable} +\paperw11906\paperh16838\margl1000\margr400\margt400\margb400\spltpgpar\htmautsp\sectd\ltrsect\nofeaturethrottle1\formshade\splytwnine\headery720\footery720\vertalt\paperw11906\paperh16838\margl1000\margr400\margt400\margb400\gutter0\deftab720\pgncont\sectlinegrid0\cols0 +\fet0\pard\plain\lang1033\widctlpar\s1\ql\fi0\li0\ri0\rtlch\fcs1\lang1033\af0\afs24\ltrch\fcs0\lang1033\f1\fs24\lang1033\langfenp1028\langfe1025 +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 Northwind Database} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 The Northwind sample database (Northwind.mdb) is included with all versions of Access. It provides data you can experiment with and database objects that demonstrate features you might want to implement in your own databases. Using Northwind, you can become familiar with how a relational database is structured and how the database objects work together to help you enter, store, manipulate, and print your data..} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 It contains the following detailed information:} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 1. Suppliers/Vendors of Northwind \endash who supply to the company.} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 2. Customers of Northwind \endash who buy from Northwind} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 3. Employee details of Northwind traders \endash who work for Northwind} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 4. The product information \endash the products that Northwind trades in} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 5. The inventory details \endash the details of the inventory held by Northwind traders.} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 6. The shippers \endash details of the shippers who ship the products from the traders to the end-customers} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 7. PO transactions i.e Purchase Order transactions \endash details of the transactions taking place between vendors & the company.} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 8. Sales Order transaction \endash details of the transactions taking place between the customers & the company.} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 9. Inventory transactions \endash details of the transactions taking place in the inventory} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1 10. Invoices \endash details of the invoice raised against the order.} +{\rtlch\fcs1\lang1033\af0\ltrch\fcs0\lang1033\f1\par} + +} \ No newline at end of file diff --git a/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Program.cs b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Program.cs new file mode 100644 index 000000000..a34bc9732 --- /dev/null +++ b/Text-file-conversion/Convert-text-file-to-RTF/.NET/Convert-text-file-to-RTF/Program.cs @@ -0,0 +1,26 @@ +ο»Ώusing Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using System.IO; + +namespace Convert_text_file_to_RTF +{ + class Program + { + static void Main(string[] args) + { + //Loads an existing Word document into DocIO instance. + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.txt"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Txt)) + { + //Creates file stream. + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.rtf"), FileMode.Create, FileAccess.ReadWrite)) + { + //Saves the Word document to file stream. + document.Save(outputFileStream, FormatType.Rtf); + } + } + } + } + } +}