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 回答