0
comment
comment
on 5/6/2013 2:16 PM
Scanning over Alvin Ashcraft’s excellent Morning Dew (a must read for .Net devs as is Chris Alcock’s Morning Brew), I came across a short article from Richard Carr on writing Fixed Width Data Files using C#. Richard creates a class that inherits from StreamWriter, and all-in it’s just over 50 lines of idiomatic C# code: using System;
using System.IO;
using System.Text;
public class FixedWidthWriter : StreamWriter
{
public int[] Widths { get; set; }
public char NonDataCharacter { get; set; }
[...]