我有一个记录类似于以下示例的文件。我想创建一个包含一百万条具有相同数据的记录的文件。我怎样才能做到这一点?

我知道Java中的文件io,可以在其中创建和写入文件。是否有任何工具或更好的方法可以做到这一点以获得更好的性能?

test;abc;tyr;ytu4;ytur<root><MessagePayload><abc><AlertCode>try</AlertCode></root>
test2;abc3;tyr4;ytu;ytur<root><MessagePayload><abc><AlertCode>ret</AlertCode></root>
test2;abc4;tyr4;ytu4;ytur<root><MessagePayload><abc><AlertCode>tue</AlertCode></root>

最佳答案

您可以使用DataFactory库来生成有意义的随机数据:https://github.com/andygibson/datafactory

您可以在Github上找到一些示例。

09-28 01:48