public static double[] LoadData(BasicEnums.ChainTypes chainType, BasicEnums.HistTypes histType) { string file = firstNameFiles + chainType.ToString(); string dir = IO.Directory.SubDirCoord; string pathFileSpinningRayValue = dir + @"\" + file + histType.ToString() + Consts.extensionOfFile; ExtendedStreamReader srSpinningRay = new ExtendedStreamReader(pathFileSpinningRayValue, Config.CurrentGuid, Config.Crypt); string allText = srSpinningRay.ReadToEnd(); if (allText != null) { string[] arrString = Regex.Split(allText, ";"); //Array.Resize(ref arrString, arrString.Length -1); //tira o bug do ENTER srSpinningRay.Close(); srSpinningRay.Dispose(); double[] arrDouble = new double[arrString.Length - 1]; for (int i = 0; i < arrString.Length - 1; i++) { arrDouble[i] = Convert.ToDouble(arrString[i]); } return(arrDouble); } else { return(null); } }
//static string Server = "Server"; //static string Web = "Web"; private void DecrypAllFiles(string[] diretories, string destination) { foreach (string path in diretories) { //string newWebFolder = path.Replace(Server, Web); Directory.CreateDirIfNotExist(destination); foreach (string tempFile in Directory.GetFilesOfDir(path)) { string newWebFile = string.Empty; //newWebFile = tempFile.Replace(Server, Web); newWebFile = destination + Path.GetFileName(tempFile); string extensionFile = Path.GetExtension(tempFile); if (extensionFile == ".xls") { File.Copy(tempFile, newWebFile, true); } else { if (param.dataToProcess.crypt) { //DADOS string line; using (ExtendedStreamReader fileReader = new ExtendedStreamReader(tempFile, this.param.dataToProcess.Guid, AppConfigClient.Crypt)) { ExtendedStreamWriter fileWriter = new ExtendedStreamWriter(newWebFile, false, this.param.dataToProcess.Guid, false); while ((line = fileReader.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } fileWriter.WriteLine(line); } fileReader.Close(); //fileReader = null; fileWriter.Flush(); fileWriter.Close(); fileWriter = null; fileReader.Dispose(); } //FIM DADOS } else { File.Copy(tempFile, newWebFile, true); } } } } }
private void SheetDebug(ref XLWorkbook workbook) { string sheetName = "debug"; var worksheet01 = workbook.Worksheets.Add(sheetName); //DADOS string line; int numberofLines = ExtendedStreamReader.LinesOfFile(dirServerDebug + @"\" + debugFile); //List<string> lines = new List<string>(); using (ExtendedStreamReader file = new ExtendedStreamReader(dirServerDebug + @"\" + debugFile, this.param.dataToProcess.Guid, this.param.dataToProcess.crypt)) { int rec = 0; int idx = 0; while ((line = file.ReadLine()) != null) { if (!(idx < 1048576)) { break; } if (String.IsNullOrEmpty(line)) { break; } WriteSecondSheet(line, idx, ref worksheet01); idx++; if (rec == 99999) { SaveDebug(ref workbook); //http://stackoverflow.com/questions/22747360/append-to-excel-file-with-closedxml //int NumberOfLastRow = worksheet01.LastRowUsed().RowNumber(); //IXLCell CellForNewData = worksheet01.Cell(NumberOfLastRow + 1, 1); rec = 0; PrintPercentCompleted(idx, numberofLines); } else { rec++; } } file.Close(); file.Dispose(); } //FIM DADOS }
/// <summary> /// Carrega as coordenadas geradas da SEMENTE /// </summary> public static void LoadSeedCoord(string file, bool firstLineIsIsemNUmber) { //string dir = Members.workSpace + @"\" + Resource.SubDirSeed; //string pathFile = dir + @"\" + file + Consts.extensionOfFile; using (ExtendedStreamReader sr = new ExtendedStreamReader(file, Config.CurrentGuid, true)) { string line = string.Empty; string[] temp = new string[3]; GCPS.Reset(); bool first = true; while ((line = sr.ReadLine()) != null) { if (first && firstLineIsIsemNUmber) { GCPS.chain.isem = Convert.ToInt32(line); first = false; } else { temp = Regex.Split(line, "\t"); //temp = line.Split(new char[] { '\t' }); GCPS.chain.r.Add(new BasicStructs.Point() { x = Convert.ToInt32(temp[0]), y = Convert.ToInt32(temp[1]), z = Convert.ToInt32(temp[2]), deadEnd = 0, deadEndPoints = string.Empty }); } } sr.Close(); sr.Dispose(); } }
private void SheetEvolutionValueMediumOfEnergy(ref XLWorkbook workbook) { string sheetName = "Evolution Energy"; string mediumValuesOfEnergy = "EvolutionEnergy.dat"; var worksheet01 = workbook.Worksheets.Add(sheetName); //DADOS string line; List <string> lines = new List <string>(); using (ExtendedStreamReader file = new ExtendedStreamReader(dirWebExcel + @"\" + mediumValuesOfEnergy, this.param.dataToProcess.Guid, false)) { while ((line = file.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } lines.Add(line); } file.Close(); file.Dispose(); } //FIM DADOS //HEADER worksheet01.Cell("A1").Value = sheetName; //INFOS string comment = string.Empty; double value = 0; int i = 0; for (i = 0; i < 5; i++) { string[] temp = lines[i].Split(':'); comment = Convert.ToString(temp[0]); worksheet01.Cell("A" + (i + 2)).Value = comment; try { value = Convert.ToDouble(temp[1]); worksheet01.Cell("B" + (i + 2)).Value = value; } catch { string valueStr = temp[1]; worksheet01.Cell("B" + (i + 2)).Value = valueStr; } } //DATA worksheet01.Cell("A7").Value = "idx"; worksheet01.Cell("B7").Value = "MCStep"; worksheet01.Cell("C7").Value = "E"; long mcstep = 0; double e = 0; long idx = 0; i++; //para pular HEADER do arquivo que já foi escrito acima (LINHA 7 do EXCEL) for (i = i; i < lines.Count; i++) { string[] temp = lines[i].Split('\t'); idx = Convert.ToInt32(temp[0]); mcstep = Convert.ToInt32(temp[1]); e = Convert.ToDouble(temp[2]); worksheet01.Cell("A" + (i + 2)).Value = idx; worksheet01.Cell("B" + (i + 2)).Value = mcstep; worksheet01.Cell("C" + (i + 2)).Value = e; } lines = null; //FIM DATASHEET }
private void SheetTrajectory(ref XLWorkbook workbook) { // This is invariant NumberFormatInfo format = new NumberFormatInfo(); // Set the 'splitter' for thousands format.NumberGroupSeparator = "."; // Set the decimal seperator format.NumberDecimalSeparator = ","; string sheetName = "Trajectory"; var worksheet01 = workbook.Worksheets.Add(sheetName); int numberLines = ExtendedStreamReader.LinesOfFile(dirServerDebug + @"\" + debugFile); //DADOS string line; List <Trajectory> trajectory = new List <Trajectory>(); int _MCStep = 0; using (ExtendedStreamReader file = new ExtendedStreamReader(dirServerDebug + @"\" + debugFile, this.param.dataToProcess.Guid, this.param.dataToProcess.crypt)) { double rg = 0; //Calculo acumulado do Raio de GIração int cont = 0; //Contador //int lastMove = 0; //valor do último movimento int contAdd = 1; //contador adicional while ((line = file.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } if (cont > 0) { string[] col = line.Split('\t'); int numberMov = ConvertCustom.ToInt32(col[0]); if (numberMov < (delta * contAdd) + 1) { rg += double.Parse(col[3], format); //coluna no qual contêm valor do raio de giração _MCStep = ConvertCustom.ToInt32(col[0]); } else { double value = ((double)1 / delta) * rg; trajectory.Add(new Trajectory() { MCStep = _MCStep, rg = value }); contAdd++; rg = 0; rg += Convert.ToDouble(col[3]); //coluna no qual contêm valor do raio de giração } } cont++; } file.Close(); file.Dispose(); } //FIM DADOS //DATASHEET worksheet01.Cell("A1").Value = sheetName; worksheet01.Cell("A2").Value = "lines"; worksheet01.Cell("B2").Value = numberLines; worksheet01.Cell("A3").Value = "MCSteps"; worksheet01.Cell("B3").Value = MCSteps; worksheet01.Cell("A4").Value = "delta"; worksheet01.Cell("B4").Value = delta; worksheet01.Cell("A5").Value = "idx"; worksheet01.Cell("B5").Value = "MCSteps"; worksheet01.Cell("C5").Value = "SUM((1 / delta) * md)"; for (int i = 0; i < trajectory.Count; i++) { double value = trajectory[i].rg; _MCStep = trajectory[i].MCStep; worksheet01.Cell("A" + (i + 6)).Value = i; worksheet01.Cell("B" + (i + 6)).Value = _MCStep; worksheet01.Cell("C" + (i + 6)).Value = value; } }
private void SheetsHistogram(ref XLWorkbook workbook) { string sheetName = string.Empty; //Recupera a quantidade de arquivos existentes string[] dir = Directory.GetFiles(dirServerHistogram); if (dir.Count() > 0) { foreach (string file in dir) { int posBar = file.LastIndexOf(@"\", StringComparison.Ordinal); int len = file.Count(); string fileName = file.Substring(posBar, len - posBar).Replace(@"\", ""); switch (fileName) { case "fileRealHistogramEndToEndDistance.dat": sheetName = "EndToEnd distance"; break; case "fileRealHistogramRadiuosOfGyration.dat": sheetName = "Radiuos of gyration"; break; default: sheetName = file; break; } var worksheet01 = workbook.Worksheets.Add(sheetName); //DADOS string line; List <string> lines = new List <string>(); using (ExtendedStreamReader stream = new ExtendedStreamReader(dirServerHistogram + @"\" + fileName, this.param.dataToProcess.Guid, this.param.dataToProcess.crypt)) { while ((line = stream.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } lines.Add(line); } stream.Close(); stream.Dispose(); } //FIM DADOS //DATASHEET for (int i = 0; i < lines.Count; i++) { string[] values = lines[i].Split('\t'); for (int j = 0; j < values.Count(); j++) { worksheet01.Cell(Convert.ToChar(65 + j).ToString() + (i + 1)).Value = values[j]; } } lines = null; //FIM DATASHEET } } }
private void SheetDistribution(ref XLWorkbook workbook) { // This is invariant NumberFormatInfo format = new NumberFormatInfo(); // Set the 'splitter' for thousands format.NumberGroupSeparator = "."; // Set the decimal seperator format.NumberDecimalSeparator = ","; string sheetName = "Distribution"; string fileName = "Distribution.dat"; string mask = ""; var worksheet01 = workbook.Worksheets.Add(sheetName); //DADOS string line; List <string> lines = new List <string>(); using (ExtendedStreamReader file = new ExtendedStreamReader(dirWebExcel + @"\" + fileName, this.param.dataToProcess.Guid, false)) { while ((line = file.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } lines.Add(line); } file.Close(); file.Dispose(); } //FIM DADOS //HEADER worksheet01.Cell("A1").Value = sheetName; worksheet01.Cell("B1").Value = mask; worksheet01.Cell("C1").Value = mask; worksheet01.Cell("D1").Value = "idx"; worksheet01.Cell("E1").Value = "mcStep"; worksheet01.Cell("F1").Value = "rg2"; worksheet01.Cell("G1").Value = "rg2(accumulated)"; worksheet01.Cell("H1").Value = "<rg2>"; worksheet01.Cell("I1").Value = "e"; worksheet01.Cell("J1").Value = "e(accumulated)"; worksheet01.Cell("K1").Value = "<e>"; worksheet01.Cell("L1").Value = "U"; worksheet01.Cell("M1").Value = "U(accumulated)"; worksheet01.Cell("N1").Value = "<U>"; //INFOS string comment = string.Empty; double value = 0; int i = 0; //DATA long idx, mcstep = 0; double rg, U, eE, eRG, eU, e, aE, aU, aRG; rg = U = eE = eRG = eU = e = aE = aU = aRG = 0; //PRIMEIRA PARTE COM HEADER for (i = 0; i < 8; i++) { string[] temp = lines[i].Split(':'); comment = ConvertCustom.ToString(temp[0]); worksheet01.Cell("A" + (i + 2)).Value = comment; try { value = ConvertCustom.ToDouble(temp[1]); worksheet01.Cell("B" + (i + 2)).Value = value; } catch (FormatException) { string strValue = Convert.ToString(temp[1]); worksheet01.Cell("B" + (i + 2)).Value = strValue; } string[] tempResult = lines[i + 9].Split('\t'); idx = ConvertCustom.ToInt32(tempResult[0]); mcstep = ConvertCustom.ToInt32(tempResult[1]); rg = double.Parse(tempResult[2], format); aRG = double.Parse(tempResult[3], format); eRG = double.Parse(tempResult[4], format); e = double.Parse(tempResult[5], format); aE = double.Parse(tempResult[6], format); eE = double.Parse(tempResult[7], format); U = double.Parse(tempResult[8], format); aU = double.Parse(tempResult[9], format); eU = double.Parse(tempResult[10], format); worksheet01.Cell("C" + (i + 2)).Value = mask; worksheet01.Cell("D" + (i + 2)).Value = idx; worksheet01.Cell("E" + (i + 2)).Value = mcstep; worksheet01.Cell("F" + (i + 2)).Value = rg; worksheet01.Cell("G" + (i + 2)).Value = aRG; worksheet01.Cell("H" + (i + 2)).Value = eRG; worksheet01.Cell("I" + (i + 2)).Value = e; worksheet01.Cell("J" + (i + 2)).Value = aE; worksheet01.Cell("K" + (i + 2)).Value = eE; worksheet01.Cell("L" + (i + 2)).Value = U; worksheet01.Cell("M" + (i + 2)).Value = aU; worksheet01.Cell("N" + (i + 2)).Value = eU; } //SEGUNDA PARTE for (int j = i; j < (lines.Count() - 9); j++) { worksheet01.Cell("A" + (j + 2)).Value = mask; worksheet01.Cell("B" + (j + 2)).Value = mask; worksheet01.Cell("C" + (j + 2)).Value = mask; string[] tempResult = lines[j + 9].Split('\t'); idx = ConvertCustom.ToInt32(tempResult[0]); mcstep = ConvertCustom.ToInt32(tempResult[1]); rg = double.Parse(tempResult[2], format); aRG = double.Parse(tempResult[3], format); eRG = double.Parse(tempResult[4], format); e = double.Parse(tempResult[5], format); aE = double.Parse(tempResult[6], format); eE = double.Parse(tempResult[7], format); U = double.Parse(tempResult[8], format); aU = double.Parse(tempResult[9], format); eU = double.Parse(tempResult[10], format); worksheet01.Cell("D" + (j + 2)).Value = idx; worksheet01.Cell("E" + (j + 2)).Value = mcstep; worksheet01.Cell("F" + (j + 2)).Value = rg; worksheet01.Cell("G" + (j + 2)).Value = aRG; worksheet01.Cell("H" + (j + 2)).Value = eRG; worksheet01.Cell("I" + (j + 2)).Value = e; worksheet01.Cell("J" + (j + 2)).Value = aE; worksheet01.Cell("K" + (j + 2)).Value = eE; worksheet01.Cell("L" + (j + 2)).Value = U; worksheet01.Cell("M" + (j + 2)).Value = aU; worksheet01.Cell("N" + (j + 2)).Value = eU; } lines = null; //FIM DATASHEET }
public void EvolutionValueMediumOfEnergy() { string readerFile = dirBaseWeb.FullName() + this.param.dataToProcess.Guid + @"\Result\Debug.dat"; string writerFile = @dirBaseWeb.FullName() + this.param.dataToProcess.Guid + @"\Result\EvolutionEnergy.dat"; //Data string line; List <ColsForEnergy> energy = new List <ColsForEnergy>(); using (ExtendedStreamReader souceFile = new ExtendedStreamReader(readerFile, this.param.dataToProcess.Guid, false)) { ExtendedStreamWriter destinationFile = new ExtendedStreamWriter(writerFile, false, this.param.dataToProcess.Guid, false); string[] cols = null; int i = 0; while ((line = souceFile.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } //pulas cabeçalho e o número de discartes if (i < 1) { for (int k = 0; k < this.valueDiscard; k++) { line = souceFile.ReadLine(); } } else { cols = line.Split('\t').ToArray(); Int32 _mcSteps = Convert.ToInt32(cols[0]); double _newE = Convert.ToDouble(cols[2]); energy.Add(new ColsForEnergy() { mcSteps = _mcSteps, e = _newE }); //pula o Delta for (int k = 0; k < this.delta; k++) { line = souceFile.ReadLine(); } } i++; } souceFile.Close(); //souceFile = null; //Write result file destinationFile.WriteLine("mcStep: {0}", this.mcSteps); destinationFile.WriteLine("valueDiscard: {0}", this.valueDiscard); destinationFile.WriteLine("delta: {0}", this.delta); destinationFile.WriteLine("temperature: {0}", param.dataToProcess.temperature); destinationFile.WriteLine("model: {0}", TranslateModel(param.dataToProcess.modelType)); destinationFile.WriteLine("idx" + "\t" + "_mcSteps" + "\t" + "energy"); for (int z = 0; z < energy.Count(); z++) { destinationFile.WriteLine(z + "\t" + energy[z].mcSteps + "\t" + energy[z].e); } destinationFile.Flush(); destinationFile.Close(); souceFile.Dispose(); } }
public void ConfigurationOutPut() { string[] files = Directory.GetFilesOfDir(dirBaseWeb.FullName() + this.param.dataToProcess.Guid + @"\Result", "Trajectory*.dat"); Array.Sort <string>(files); Array.Reverse(files); string readerLastFile = files[0]; Array.Sort <string>(files); //Data string line; List <string> configurations = new List <string>(); //FILEs - lê arquivo por arquivo efetuando o SALTO de MCTSP efetuado string readerFirstFile = string.Empty; ExtendedStreamReader souceFirstFile; int i = 0; for (int numberOfFile = 0; numberOfFile < files.Length; numberOfFile++) { readerFirstFile = files[numberOfFile]; using (souceFirstFile = new ExtendedStreamReader(readerFirstFile, this.param.dataToProcess.Guid, false)) { bool readHeader = false; while ((line = souceFirstFile.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } //cabeçalho do primeiro arquivo if (!readHeader) { configurations.Add(line); readHeader = true; line = souceFirstFile.ReadLine(); } if (i == 0) { //for (int k = 0; k < this.valueDiscard; k++) //{ // line = souceFirstFile.ReadLine(); //} configurations.Add(line); } else { //if (i == param.output.configurationJumpStep) //{ // i = 0; configurations.Add(line); //} } i++; } souceFirstFile.Close(); souceFirstFile.Dispose(); } } //LAST FILE string writerConfigurationFile = dirBaseWeb.FullName() + this.param.dataToProcess.Guid + @"\Result\Configuration.dat"; ExtendedStreamWriter destinationFile = new ExtendedStreamWriter(writerConfigurationFile, false, this.param.dataToProcess.Guid, false); line = string.Empty; string last = File.ReadLastLineOfFile(readerLastFile); configurations.Add(last); souceFirstFile = null; //Write result file foreach (string data in configurations) { destinationFile.WriteLine(data); } destinationFile.Flush(); destinationFile.Close(); //Após consolidar arquivo de CONFIGURATION.DAT, os arquivos de TRAJETORY* devem ser descartados foreach (string file in files) { File.Delete(file); } }
public void LoadConfigurationOutPutForOrigin() { GICO.WriteLine(String.Format(" Output: LoadConfigurationOutPutToOrigin: Delete...")); ////Delete IF EXIST //using (GridProteinFoldingEntities ctx = new GridProteinFoldingEntities()) //{ // ctx.Database.ExecuteSqlCommand("DELETE FROM OUTPUT WHERE guid= {0}", param.dataToProcess.Guid); //} string readerFile = dirBaseWeb.FullName() + this.param.dataToProcess.Guid + @"\Result\Configuration.dat"; using (ExtendedStreamReader souceFile = new ExtendedStreamReader(readerFile, this.param.dataToProcess.Guid, false)) { string line; int i = 0; GICO.WriteLine(String.Format(" Output: LoadConfigurationOutPutToOrigin: Insert...")); while ((line = souceFile.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } //pulas cabeçalho e o número de discartes if (i == 0) { line = souceFile.ReadLine(); } string[] data = line.Split('\t').ToArray(); Int32 mcStep = 0; int order = 0; int count = 0; using (TransactionScope scope = new TransactionScope()) { GridProteinFoldingEntities ctx = null; try { ctx = new GridProteinFoldingEntities(); Entities.Internal.Configuration configuration = null; for (int j = 0; j < data.Length; j++) { if (j == 0) { mcStep = Convert.ToInt32(data[j]); j++; } configuration = new Entities.Internal.Configuration(); configuration.process_guid = this.param.dataToProcess.Guid; configuration.mcStep = mcStep; configuration.order = order; configuration.x = Convert.ToInt32(data[j]); j++; configuration.y = Convert.ToInt32(data[j]); j++; configuration.z = Convert.ToInt32(data[j]); order++; ++count; ctx = AddToContext(ctx, configuration, count, 100, true); //ctx.Configuration.Add(configuration); } if (configuration != null) { ctx.SaveChanges(); configuration = null; } } finally { if (ctx != null) { ctx.Dispose(); } } scope.Complete(); } i++; } souceFile.Close(); //souceFile = null; souceFile.Dispose(); } }
public void Distribution() { try { string readerFile = dirBaseWeb.FullName() + this.param.dataToProcess.Guid + @"\Result\Debug.dat"; string writerFile = dirBaseWeb.FullName() + this.param.dataToProcess.Guid + @"\Result\Distribution.dat"; Guid guid = param.dataToProcess.Guid; int isem = param.dataToProcess.isem; int sitios = param.dataToProcess.totalSitio; //Data string line; List <ColsForDepedentModel> md = new List <ColsForDepedentModel>(); using (ExtendedStreamReader souceFile = new ExtendedStreamReader(readerFile, this.param.dataToProcess.Guid, false)) { ExtendedStreamWriter destinationFile = new ExtendedStreamWriter(writerFile, false, this.param.dataToProcess.Guid, false); string[] cols = null; int i = 0; while ((line = souceFile.ReadLine()) != null) { if (String.IsNullOrEmpty(line)) { break; } //pulas cabeçalho & faz o discarte o número de discartes if (i == 0) { for (int k = 0; k < this.valueDiscard; k++) { line = souceFile.ReadLine(); } } else { cols = line.Split('\t').ToArray(); Int32 _mcSteps = Convert.ToInt32(cols[0]); double _rg = Convert.ToDouble(cols[3]); double _e = Convert.ToDouble(cols[2]); double _U = Convert.ToDouble(cols[8]); md.Add(new ColsForDepedentModel() { mcSteps = _mcSteps, rg = _rg, e = _e, U = _U }); //pula o Delta for (int k = 0; k < this.delta; k++) { line = souceFile.ReadLine(); } } i++; } souceFile.Close(); //souceFile = null; //Write result file destinationFile.WriteLine("simulation id: {0}", guid.ToString()); destinationFile.WriteLine("isem: {0}", isem); destinationFile.WriteLine("sitios: {0}", sitios); destinationFile.WriteLine("model: {0}", TranslateModel(param.dataToProcess.modelType)); destinationFile.WriteLine("mcStep: {0}", this.mcSteps); destinationFile.WriteLine("temperature: {0}", param.dataToProcess.temperature); destinationFile.WriteLine("valueDiscard: {0}", this.valueDiscard); destinationFile.WriteLine("delta: {0}", this.delta); destinationFile.WriteLine("idx\t mcSteps\t rg2\t rg2(accumulated)\t <rg2>\t e\t e(accumulated)\t <e>\t U\t U(accumulated)\t <U>"); double aRG2, eRG2, previousRG2, actualRG2; aRG2 = eRG2 = previousRG2 = actualRG2 = 0; double aE, eE, previousE, actualE; aE = eE = previousE = actualE = 0; double aU, eU, previousU, actualU; aU = eU = previousU = actualU = 0; Int64 idx = 0; for (int z = 0; z < md.Count(); z++) { idx = (z + 1); //Acumulado aRG2 += md[z].rg; aE += md[z].e; aU += md[z].U; //Evolução do RAIO DE GIRAÇÃO actualRG2 = md[z].rg; eRG2 = aRG2 / idx; previousRG2 = eRG2; //Evolução do E actualE = md[z].e; eE = aE / idx; previousE = eE; //Evolução do U actualU = md[z].U; eU = aU / idx; previousE = eU; destinationFile.WriteLine(z + "\t" + md[z].mcSteps + "\t" + actualRG2 + "\t" + aRG2 + "\t" + eRG2 + "\t" + actualE + "\t" + aE + "\t" + eE + "\t" + actualU + "\t" + aU + "\t" + eU); } destinationFile.Flush(); destinationFile.Close(); souceFile.Dispose(); } } catch (Exception ex) { GICO.WriteLine(ex); throw; } }