简体   繁体   English

从文本文件中读取工单数据

[英]Read the Ticket data from a text file

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.我需要将信息列表(乐透票信息示例名称、地址、电话号码和选择的号码)存储在.txt文件中,并将其转换为 java 并根据此信息创建票证 object。

I'm struggling to get it working with the mix of string and int data types.我正在努力让它与stringint数据类型的混合一起工作。 (Also some values have spaces like addresses that may contain 3 or more words) (还有一些值有空格,比如可能包含 3 个或更多单词的地址)

This is the Text file:这是文本文件: 例子

This is the code:这是代码: 在此处输入图像描述

First of all try to separate values by comma "," and convert the file format to CSV .首先尝试用逗号“,”分隔值并将文件格式转换为CSV This will fix the multi-word values problem.这将解决多词值问题。

Then read this answer for the steps you should take.然后阅读此答案以了解您应该采取的步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM