diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..cf5758d4d3a44279f4289bf7c3c20b2d718c6485 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Java +.idea/ +out/ + +# C Sharp +[Bb]in/ +[Oo]bj/ + +# Python +.vscode/ \ No newline at end of file diff --git a/C#/prototype_csharp/.vs/prototype_csharp/DesignTimeBuild/.dtbcache.v2 b/C#/prototype_csharp/.vs/prototype_csharp/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000000000000000000000000000000000000..fe90051e53643c2ba38fc63978b262dfbfcec3df Binary files /dev/null and b/C#/prototype_csharp/.vs/prototype_csharp/DesignTimeBuild/.dtbcache.v2 differ diff --git a/C#/prototype_csharp/.vs/prototype_csharp/v16/.suo b/C#/prototype_csharp/.vs/prototype_csharp/v16/.suo new file mode 100644 index 0000000000000000000000000000000000000000..f263dc450c62ebd33827d7b254134509403c73a6 Binary files /dev/null and b/C#/prototype_csharp/.vs/prototype_csharp/v16/.suo differ diff --git a/C#/prototype_csharp/prototype_csharp.sln b/C#/prototype_csharp/prototype_csharp.sln new file mode 100644 index 0000000000000000000000000000000000000000..9cfbb3e4e3811d6ba02b12d52258f04f887b6812 --- /dev/null +++ b/C#/prototype_csharp/prototype_csharp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31129.286 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "prototype_csharp", "prototype_csharp\prototype_csharp.csproj", "{FC4A3022-58C4-430D-B12B-E58D412E95AD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FC4A3022-58C4-430D-B12B-E58D412E95AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC4A3022-58C4-430D-B12B-E58D412E95AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC4A3022-58C4-430D-B12B-E58D412E95AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC4A3022-58C4-430D-B12B-E58D412E95AD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7B5C9067-968F-42C4-B4B5-138212FE9A05} + EndGlobalSection +EndGlobal diff --git a/C#/prototype_csharp/prototype_csharp/Program.cs b/C#/prototype_csharp/prototype_csharp/Program.cs new file mode 100644 index 0000000000000000000000000000000000000000..e0dbbb575bd5cd27f6221df0aef7e213752d6b31 --- /dev/null +++ b/C#/prototype_csharp/prototype_csharp/Program.cs @@ -0,0 +1,27 @@ +using Microsoft.Office.Interop.Excel; +using System; +using System.IO; +using Range = Microsoft.Office.Interop.Excel.Range; + +namespace prototype_csharp +{ + class Program + { + static void Main(string[] args) + { + string filename = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"../../../../../../")) + "demo.xlsx"; + var excelApp = new Microsoft.Office.Interop.Excel.Application(); + + Workbook workbook = excelApp.Workbooks.Open(filename); + Worksheet worksheet = workbook.Worksheets[1]; + Range range = worksheet.UsedRange; + + string strResult = (string)(range.Cells[1, 1] as Range).Value2; + Console.WriteLine(strResult); + + //Garbage Collector things + workbook.Close(); + excelApp.Quit(); + } + } +} diff --git a/C#/prototype_csharp/prototype_csharp/prototype_csharp.csproj b/C#/prototype_csharp/prototype_csharp/prototype_csharp.csproj new file mode 100644 index 0000000000000000000000000000000000000000..0ad361ad90901eef27c3e4aeef1ddc3a6a12d093 --- /dev/null +++ b/C#/prototype_csharp/prototype_csharp/prototype_csharp.csproj @@ -0,0 +1,20 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>netcoreapp3.1</TargetFramework> + </PropertyGroup> + + <ItemGroup> + <COMReference Include="Microsoft.Office.Interop.Excel"> + <WrapperTool>tlbimp</WrapperTool> + <VersionMinor>9</VersionMinor> + <VersionMajor>1</VersionMajor> + <Guid>00020813-0000-0000-c000-000000000046</Guid> + <Lcid>0</Lcid> + <Isolated>false</Isolated> + <EmbedInteropTypes>true</EmbedInteropTypes> + </COMReference> + </ItemGroup> + +</Project> diff --git a/Java/Java.iml b/Java/Java.iml new file mode 100644 index 0000000000000000000000000000000000000000..b923cfd2a0bd59fdbcb5d6bd8abb2b3c975e37d9 --- /dev/null +++ b/Java/Java.iml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="poi-ooxml-5.0.0" level="project" /> + </component> +</module> \ No newline at end of file diff --git a/Java/src/com/company/Main.java b/Java/src/com/company/Main.java new file mode 100644 index 0000000000000000000000000000000000000000..f2d64dfcfe69586c7650714fbaedfe8fbee7671b --- /dev/null +++ b/Java/src/com/company/Main.java @@ -0,0 +1,25 @@ +package com.company; + +import org.apache.poi.ss.usermodel.*; + +import java.io.File; + +public class Main { + + public static void main(String[] args) { + // write your code here + try { + File directory = new File(System.getProperty("user.dir")); + String filename = directory.getParent() + "/demo.xlsx"; + + Workbook workbook = WorkbookFactory.create(new File(filename)); + Sheet sheet = workbook.getSheetAt(0); + Row row = sheet.getRow(1); + Cell cell = row.getCell(0); + + System.out.println(cell.getStringCellValue()); + } catch (Exception ex) { + System.out.println(ex.toString()); + } + } +} diff --git a/Python/prototype_py.py b/Python/prototype_py.py new file mode 100644 index 0000000000000000000000000000000000000000..f1f27bbda1c0abbe619a9ca9bf54a804b0b1054e --- /dev/null +++ b/Python/prototype_py.py @@ -0,0 +1,6 @@ +import openpyxl + +filename = openpyxl.load_workbook('../demo.xlsx') +sheet = filename["Tabelle1"] + +print(sheet['A1'].value) \ No newline at end of file diff --git a/demo.xlsx b/demo.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..ea0643142c45f6e261173d00cd9d922b82fa6d39 Binary files /dev/null and b/demo.xlsx differ