英文:
Read the Ticket data from a text file
问题
我需要在一个 .txt 文件中存储一系列信息(例如彩票票务信息,包括姓名、地址、电话号码和所选号码),然后将其转换为 Java 代码,并根据这些信息创建票务对象。
我发现最好的方法是使用字符串分割器(string[] splitter)和必要的解析(pharses)。
英文:
I need to store a list of information (Lotto Ticket information example Name, Address, Phone number and chosen number) in a .txt file and convert it into java and create the ticket object from this information.
Best way to do this, I found was was using a string[] splitter and pharses as needed
答案1
得分: 1
首先,尝试使用逗号 "," 将值分隔,并将文件格式转换为 CSV
。这将解决多词值的问题。
然后阅读这个答案,了解你应该采取的步骤。
英文:
First of all try to separate values by comma "," and convert the file format to CSV
. This will fix the multi-word values problem.
Then read this answer for the steps you should take.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论