データをインポートするために、プリンター制御言語 (PCL) を含む古いメインフレーム テキスト ファイルをスクレイピングする必要があります。メインフレームの機能を変更することはできません。印刷物には製品販売情報が含まれており、階層的な出力があります。
私の希望は、Sql Server Integration Service インポート (SSIS) をセットアップすることです。最終的に、これは SQL 2005 データベースを使用したデータ インポート ASP.NET MVC 3 Web サイトになるため、SSIS を回避できます。私は現在、C# ASP.NET MVC 3 Web サイトを構築しているため、関連するテクノロジを使用することは管理しやすいはずです。
C# または SSIS でテキスト パターン (正規表現など) を使用して、テキスト レポートを解析して有用なデータ インポートに戻すことに成功した人はいますか? 状態の設計パターンを使用した例はありますか?
これらの回答の多くは、回答のごく一部を示しています。テキスト ファイルをロードして C# で n 番目の列を取得する方法です。これはより複雑です。現在のインポート状態に基づいたパターンで各ライン タイプを識別する必要があります。既製のソフトウェアはさらに優れています。
テキスト ファイルの例:
this part may be a header for the page which needs skipped
this part may be a header for the page which needs skipped
this part may be a header for the page which needs skipped
first line containing prices
second line containing product description for the first line
third line containing a related product (listing all flavors)
fourth line containing a description for the third line
[third and forth may repeat]
[product set summary line]
[ repeat for next product]
this part may be a footer for the page that needs skipped
this part may be a footer for the page that needs skipped
at any point, the products will span between pages,
having header and footer lines between product data.