0

how can i export set of data in SQL or Access to text file with text align ? there is a AS400 system. witch employees have to enter Purchase orders one by one. (customers send their Purchase orders by Excel) i created a tool using C# to import excel and import to a access DB and i want to know how to export to a text file with correct text length.(so i can import to the System Direcly) this is the format i want

Name| Width|Type|Alignment|Remark

NO|10| N| Right left | pad with blank

Type|2| C| Left|Default 'SO'

Company|5| C| Left| Default Blank

Depot Code|12| C|Right| left pad with blank

Customer Code|9|N| Right|left pad with blank

Out put :-- 40000013SO 211 5031JHX400B PKPK 500 041013

4

1 に答える 1

0

を使用するだけでこれを実現できますstring.Format()http://msdn.microsoft.com/en-us/library/system.string.format.aspxを読んでください。フィールドの幅とテキストの配置を指定できる場合は、必要に応じてフィールドをレイアウトできます。

于 2013-11-06T09:43:08.667 に答える