0
Good afternoon. I am trying to generate a text file and it only works on the first line. From the second line, it gives you a space that you can’t solve.
foreach (DadosSQL dados in listaDados){
sb.AppendFormat("{0, -18}{1, -10}{2, -37}{3, -15}{4, -25}{5, -10}{6, -15}{7, -18}{8, -20}{9, -11}{10, -22}{11, -19}{12, -21}{13, -21}",
dados.REFERENCIA_ALIADO.ToString(), dados.COD_SKU_USUARIO, dados.NOM_SKU, dados.DESCRICAO, dados.NOM_MARCA_SORTIMENTO, dados.QTD_DISPONIVEL, dados.TIENDA, dados.PRECO, dados.PRECO_COM_DESCONTO,
dados.DESCONTO, dados.INICIO_DESCONTO, dados.FIM_DESCONTO, dados.CATEGORIA_1, Environment.NewLine);}
File.WriteAllText(@"c:\\Teste\\teste.txt", sb.ToString());
The output is in the attached image:
Thank you very much.
– HMC123