Hello All,
I am writing a code that collects all the credit card information of each buyer and storing it in a File. The format that I am using to store information in a file is:
[Credit Card Number] | [User Name] | [Street Address] | [Zipcode] | @
[Credit Card Number] | [User Name] | [Street Address] | [Zipcode] | @
.....
Now, Credit Card Number
, <User Name>
, <Street Address>
and <Zipcode>
are actual UI fields. I capture this information, use Field separator "|" and record separator "@" in my code so that I can access fields and records as and when I need. But this is just a logic I have and now I have begun to wonder if this would work, primarily due to the File API in Java. There is no method that lets me access specific fields in a record even after having a delimiter. I also checked RandomAccessFile API.
Can anyone please suggest me other possible approaches to this problem?
I want to differentiate between fields in a record and between various records so that I can perform operations like searching for a user with Credit Card Number = XXX and pull out the details.