public outputLine(inputLine inputLine) { this.Name = inputLine.firstName + " " + inputLine.lastName; this.GivenName = inputLine.firstName; this.Address1Street = inputLine.streetAddress; this.Phone1Value = inputLine.phoneNumber; this.Email1Value = inputLine.emailAddress; }
private void btnFix_Click(object sender, EventArgs e) { try { File.ReadAllLines(originalFile).ToList(); } catch (Exception ex) { ShowMessage("Oops, something went wrong!\r\n~debug info~\r\n" + ex.Message + "\r\nPlease try another input file."); } List <string> originalLines = File.ReadAllLines(originalFile).ToList(); foreach (string originalLine in originalLines) { List <string> lineItems = originalLine.Split(',').ToList(); inputLine newLine = new inputLine(); newLine.fromList(lineItems); listItems.Add(newLine); } List <outputLine> outList = new List <outputLine>(); outList.Add(new outputLine("1337HAX_HEADER_PLZ")); foreach (inputLine lineItem in listItems) { outList.Add(lineItem.toOutputLine()); } StringBuilder outputBuilder = new StringBuilder(); string[] outArray = new string[outList.Count]; int i = 0; foreach (outputLine item in outList) { outArray[i++] = item.ToString().Replace('\t', ','); } File.WriteAllLines(newFile, outArray); ShowMessage("File Fixed Successfully!"); }
public inputLine toInputLine() { inputLine newLine = new inputLine(this); return(newLine); }