{"id":87,"date":"2007-01-08T20:20:03","date_gmt":"2007-01-08T18:20:03","guid":{"rendered":"http:\/\/gschizas.homeip.net\/blog\/index.php\/2007-01-08\/import-and-export-in-net\/"},"modified":"2019-11-14T01:54:18","modified_gmt":"2019-11-13T23:54:18","slug":"import-and-export-in-net","status":"publish","type":"post","link":"https:\/\/www.terrasoft.gr\/blog\/?p=87","title":{"rendered":"Import and Export in .NET"},"content":{"rendered":"<p>A common task in making &#8220;integration&#8221; projects is usually the part where the programmer needs to open an external file, which is in a (very) legacy format and parse this file. This obviously results in large and boring glue code, which bloats the project and makes it scary.Enter <a title=\"FileHelpers SourceForge Site\" href=\"http:\/\/filehelpers.sourceforge.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">FileHelpers<\/a>, which really simplifies the whole procedure. All you need to do is make a class of your data (actually what one line is) and add one or two attributes. For example:<\/p>\n<pre language=\"vb\" escaped=\"true\">\r\n&lt;FileHelpers.DelimitedRecord(vbTab), FileHelpers.IgnoreFirst()&gt; _\r\nPublic Class BicFile\r\n    Public Name As String\r\n    Public Description As String\r\n    Public Amount As Decimal\r\n    &lt;FileHelpers.FieldConverter(FileHelpers.ConverterKind.Date, \"yyMMdd\")&gt; _\r\n    Public OpenDate As Date\r\nEnd Class\r\n<\/pre>\n<p>Obviously this simplifies everything and saves a lot of boring code. The program is open sourced, and it is also available in library format (so that you just add a .dll reference to your project). I wish I found that earlier!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common task in making &#8220;integration&#8221; projects is usually the part where the programmer needs to open an external file, which is in a (very) legacy format and parse this file. This obviously results in large and boring glue code, which bloats the project and makes it scary.Enter FileHelpers, which really simplifies the whole procedure. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[3],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","tag-coding"],"_links":{"self":[{"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/87"}],"collection":[{"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=87"}],"version-history":[{"count":3,"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":20267,"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=\/wp\/v2\/posts\/87\/revisions\/20267"}],"wp:attachment":[{"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.terrasoft.gr\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}