From 88d1b3a1af958b50c346599537a5b715889b8ee1 Mon Sep 17 00:00:00 2001 From: Sabine Gubitz Date: Thu, 24 Nov 2022 13:59:26 +0100 Subject: [PATCH] Test? --- .idea/.gitignore | 3 + .idea/.name | 1 + .idea/misc.xml | 6 ++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 ++ VPR_SCRIPT.iml | 11 ++++ out/production/VPR_SCRIPT/Execute.class | Bin 0 -> 1124 bytes .../VPR_SCRIPT/GeneralMethods.class | Bin 0 -> 2045 bytes src/Execute.java | 13 +++++ src/GeneralMethods.java | 53 ++++++++++++++++++ test.csv | 7 +++ test2.csv | 7 +++ 12 files changed, 115 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/.name create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 VPR_SCRIPT.iml create mode 100644 out/production/VPR_SCRIPT/Execute.class create mode 100644 out/production/VPR_SCRIPT/GeneralMethods.class create mode 100644 src/Execute.java create mode 100644 src/GeneralMethods.java create mode 100644 test.csv create mode 100644 test2.csv diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..0b19974 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Execute.java \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..2c0f267 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VPR_SCRIPT.iml b/VPR_SCRIPT.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/VPR_SCRIPT.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/VPR_SCRIPT/Execute.class b/out/production/VPR_SCRIPT/Execute.class new file mode 100644 index 0000000000000000000000000000000000000000..11f93cbf4a6833318790dc9ab7c93cab6b32498d GIT binary patch literal 1124 zcmZux%Tg0T6g`~;CJDpC06`HER5am{QG6Q&kylw2&?>Afbk!tXFqmYhNeAIm`~udx zKy+cb_Cx##t9+bJCPIqLqPy?uzUSO~`}X|!^Yt5mr&x<4gs_E(jSh4Q^zF)h>6Bz; z+j+UQs|s46bIz@}dR`!$O6Q}93PiQ4>P(@!A4eQr7Hk{c=n?2yQx)aQ(z?<+Ua`u9 zzLLddsii z=L;lLXL()(c(w~k3|Y8n;}V7i5~noHBLdcrtZt|SCdu617>^MfS1>9Nsnp?tCij_& zWG#%f6snO;4A*eo!VMb}xY@dYSk>VY-=g z>luc-XFN(3lC-NPFDD}qGnX^lyq()N?qHVad!H3+T*YJ?=e9SI&Re)g*_8uTsA4S4}k zG+gHzg^tqSCRcwOKW-N5Ef!R^wN)sZYz^*kuNmOkzWLvObLZvfNz%QkW#Qer+zXP6 zZ+bPqpjKUzz8z$kF_B{&cloHy7lJU)isOA+4rjr+WAZb^$NKgIj%J%69&)sU^&>o{ z6~hx`i5TZ2l0`T>3G0L5uS31n>I#1be5e1Sv)#}EiOw?$fD9Yvy+CAL2$ zU%;#V0(PjR{Or$2RsJEBs+gSKl|YJ2m8oK9x2OB`>C-)<*KdCN1HcqE4TR935jGJ) zqeAN=>lZ6gu!>uW#f?XH&QoZdbc&9bR%jTGu4ptVT=bpxJg1PDc3taf#@Y1@Xu&yG z1F__}PI1e?d0fzFG0}?mD$zx!l-P6%cH+L}ZSN9%%Vw_BaORXi5S@BhZ;A${8jO^I zi)h#AFwu$k>(bn1E~YVE+saQD3K^#;pF`z*wMb=nzd)%ibq?L=(daet0s0g!oYpVf z3Qdk@yOvjS6*`Bjqvy+ZA`Dspz`KXhjrCKfieANzUH!oKn$190?OwrTr~C zY?!y?S-GE0#v1G|CixFO^8>Hnyd`x#v^ zFpitzktCxsSwaNiDcRTP5vM5=X@QA6mW*P#Wnx;0>Z1KvdMLJ86Su_{$rVbwqAqd-errj)Y^E0*iXci9;BwjBnwW@=$l z?6l0!ZOgM1qSZ22Y6}Ll_GmCHTwq>FRyW<;%lmL0XM{#1)F*Q~GyYI2C_p7;0ce#q5q(8&$ygxfxYp1Ma^OCbww7fl+RHxom zursim{V52*{iU#Sm=EYe6EDSf^pI{ZZt!Bfi9UMuW0DuwEe!fR zC&(qi)4YI1MmOujc$#Bf6#YKAEjZ)BaVmk3E^Av{0`sqO+@{hOhlL2BaE*d;rbfI{p1jzWm#+L zM3LSqMdG5!Wc&c1?;rokWo92uS*~NxeX>dZdR8PEVP+u4-?uoT7-h+0EHyz{t|G~| zDc(|PT*C||PGpHP<_BMvR$kse!XnW$MG`S&DrT|aiy?1;Xd+9{c(I5qBE|s1|Dr=< b+*e}om~#@M5>&?*BV1M^NB2D4L$Ln?$m--5 literal 0 HcmV?d00001 diff --git a/src/Execute.java b/src/Execute.java new file mode 100644 index 0000000..2e37190 --- /dev/null +++ b/src/Execute.java @@ -0,0 +1,13 @@ +import java.util.ArrayList; + +/**The class Execute is the executen file for the whole programm. + */ +public class Execute { + public static void main (String[]args){ + ArrayList data = GeneralMethods.readData("test.csv"); + for(String d : data){ + System.out.println(d); + } + GeneralMethods.writeData("test2.csv",data); + } +} diff --git a/src/GeneralMethods.java b/src/GeneralMethods.java new file mode 100644 index 0000000..872442d --- /dev/null +++ b/src/GeneralMethods.java @@ -0,0 +1,53 @@ +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; + +/**GeneralMethods is a class for commen public methods. + * + * @auhtor Felix Wöstemeyer + * + * @version 1.0 + */ +public class GeneralMethods { + + /**The method readData gives back an ArrayList from the data of a given file. + * + * @param pathRead the given filepath to read + * @return returns an ArrayList of Strings with the read data + */ + public static ArrayList readData(String pathRead){ + try { + ArrayList data = new ArrayList(); + List lines = Files.readAllLines(Paths.get(pathRead)); + for(String line : lines){ + data.add(line); + } + return data; + } catch (IOException e) { + e.printStackTrace(); + return new ArrayList(); + } + } + + /**The method writeData saves the given data to a certain file. + * + * @param pathWrite the given filepath to write + * @param data the data to be saved + */ + public static void writeData(String pathWrite, ArrayList data){ + try{ + BufferedWriter writer = new BufferedWriter(new FileWriter(pathWrite)); + for (String d : data) { + writer.write(d); + writer.newLine(); + } + writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/test.csv b/test.csv new file mode 100644 index 0000000..43bcbe6 --- /dev/null +++ b/test.csv @@ -0,0 +1,7 @@ +erstdfzg +rsedtfgzhu +ersdtfgzhuji +trdfzghui +rtdfzu +t +dztdrs5456 \ No newline at end of file diff --git a/test2.csv b/test2.csv new file mode 100644 index 0000000..16a6e97 --- /dev/null +++ b/test2.csv @@ -0,0 +1,7 @@ +erstdfzg +rsedtfgzhu +ersdtfgzhuji +trdfzghui +rtdfzu +t +dztdrs5456