Ash_
Ash_
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
thank you all for helping, it works and is shorter c:
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
eh it works with combine so don't really give two lines about that .-.
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
should be using the .net framework 4.8.0?
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
Also it says that the .Join part is not found
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
thank you very much, still trying variations to make it easier to understand, what does the params object?[] values do?
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
instead of what should i use that?
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
i meant that, thanks for the other one
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
why would i need that?
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
hm?
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
yeah it is a list
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
no, but in germany because of some bs it's a semicolon, because it's a semicolon seperated value... oh wait...
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
it's a csv hence i need the seperators
public static string AsCsv()
{
string filename = DateTime.Now.ToString(DateTime.Now.ToString("yyyy-MM-dd_HH:mm"))+"-Artikel.csv";
TextWriter tw = new StreamWriter("../../Exports/"+filename);
tw.WriteLine("GTIN" + Stringseperator + "Artikelnummer" + Stringseperator + "Bezeichnung"
+ Stringseperator + "Warengruppe" + Stringseperator + "Preis");
for (int i = -1; i < Auftrag.Auftragsliste.Count; i++)
{
Artikel thing = Auftrag.Auftragsliste.ElementAt(i);
string line = thing.Gtin + Stringseperator + thing.Artikelnummer + Stringseperator + thing.Bezeichnung
+ Stringseperator + thing.Warengruppe + Stringseperator + thing.Preis;
tw.WriteLine(line);
}
tw.Close();
return filename;
}
public static string AsCsv()
{
string filename = DateTime.Now.ToString(DateTime.Now.ToString("yyyy-MM-dd_HH:mm"))+"-Artikel.csv";
TextWriter tw = new StreamWriter("../../Exports/"+filename);
tw.WriteLine("GTIN" + Stringseperator + "Artikelnummer" + Stringseperator + "Bezeichnung"
+ Stringseperator + "Warengruppe" + Stringseperator + "Preis");
for (int i = -1; i < Auftrag.Auftragsliste.Count; i++)
{
Artikel thing = Auftrag.Auftragsliste.ElementAt(i);
string line = thing.Gtin + Stringseperator + thing.Artikelnummer + Stringseperator + thing.Bezeichnung
+ Stringseperator + thing.Warengruppe + Stringseperator + thing.Preis;
tw.WriteLine(line);
}
tw.Close();
return filename;
}
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
i figured but i don't know any different way of doing that
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
oh that, i am simply reusing the same variables within the class
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
could you reference the line(s) for this? i code mostly in german and don't know what a field is regarding c#?
84 replies
CC#
Created by Ash_ on 12/15/2022 in #help
❔ shorter way to export a list to a csv?
the loop, personal preference, 0 is the first element for me and the head is no relevant data for me, hence the head is -1 for me, and i'm sorry but i don't know what field means, i'm not that good at english
84 replies