• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

its urgent..pls help me out!!!

 
bhaskaritp naidu
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!

These are the records in a file.i need to pasre this records and i have use these data and according to their usage ,i have create invoice(bill).

please tell me the methods to parse this file and how to store this records.


CUST001|USAGE||0044234567892|20071101081020|20071101084012|
CUST001|USAGE|4026959526|0015137233456|20071101200240|20071101200730|
CUST009|MRC|Montly Rent|119|20071101000000|20071130000000|
CUST010|MRC|Montly Rent|119|20071001000000|20071031000000|
CUST006|USAGE|4026959526|0015137233456|20071103161419|20071103161806|
CUST006|USAGE|4026959526|00914466557878|20071102121007|20071102121059|
CUST006|USAGE|4026959526|00914066232973|20071102061009|20071102062742|
CUST001|USAGE|4026959526|0015137233456|20071102161419|20071101161806|
CUST001|USAGE|4026959526|00914466557878|20071101121007|20071101121059|
CUST001|USAGE|4026959526|00914066232973|20071102061009|20071102062742|
CUST001|USAGE|2269467676|4023457689|20071102074018|20071102080722|
CUST001|USAGE|2269467676|2245674568|20071101141206|20071101141301|
CUST006|MRC|Montly Rent|119|20071101000000|20071130000000|
CUST001|USAGE|4026959526|4423556787|20071102235543|20071103014002|
CUST004|MRC|Montly Rent|119|20071101000000|20071130000000|
CUST001|USAGE|4026959526|4026959590|20071102101002|20071102101207|
CUST001|USAGE|4026959526|4026959590|20071103221012|20071103235323|
CUST006|USAGE||0044234567892|20071102081020|20071102084012|
CUST006|USAGE||0015137233456|20071102200240|20071102200730|
CUST009|USAGE|2269467676|2245674568|20071101141206|20071101141301|
CUST009|USAGE|4026959526|4423556787|20071102235543|20071102014002|
CUST001|MRC|Montly Rent|119|20071101000000|20071130000000|
CUST001|MRC|Spl Plan Fee|49|20071101000000|20071130000000|
CUST009|USAGE|4026959526|4026959590|20071102101002|20071102101607|
CUST006|USAGE|2269467676|4023457689|20071102064018|20071102080722|
CUST006|USAGE|2269467676|2245674568|20071101141206|20071101141301|
CUST006|USAGE|4026959526|4423556787|20071102235543|20071103014002|


Thanks in Advanced
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Although this is not the right forum to post your question, I'm going to answer

First of all, create a BufferedWriter on this file, this will help you read the file line by line.

After that, for each line do the following:



This will separate all the values in each record based on the '|' character.

I hope this helps ...

Best of luck ...
 
bhaskaritp naidu
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!

let me first tell,what i need.

please look into the records carefully.

each cutomer have multiple records ,they are identified by their calling number.

i am giving follow records for example.

CustomerRef|EventType|CallInfo|Destination No/MRC Amount|StartTime|End Time

CUST001|USAGE||0044234567892|20071101081020|20071101084012|
CUST001|USAGE|4026959526|0015137233456|20071101200240|20071101200730|
CUST009|MRC|Montly Rent|119|20071101000000|20071130000000|
CUST010|MRC|Montly Rent|119|20071001000000|20071031000000|
CUST006|USAGE|4026959526|0015137233456|20071103161419|20071103161806|
CUST006|USAGE|4026959526|00914466557878|20071102121007|20071102121059|


I need to format this records.and i want to separate each customer records separately.and i want to store each customer details separetely.

Pls help me out in this.

Thanks in advance.
Boss.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11943
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Marc - thanks for closing yet another version of this.]

Bhaskaritp - we are not a code mill, but we are willing to help. For us to help you, we need you to show some effort - what have you done since Vassili gave you some hints? We would prefer it if you could post real code showing where you are at and where you are having problems.

In addition, you should carefully choose one forum, ease up, and use a meaningful subject line. You might also like to review how to ask questions on JavaRanch/

- Andrew
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bhaskaritp naidu:
...i want to separate each customer records separately.and i want to store each customer details separetely...

Vassili's suggestion of using String's split method looks like a good start to me. How did that work for you?
 
Tempora Telora
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That split is a perfect work around.

Try and create a driver class that will parse through the txt file and then create some customer classes that will store the values of the driver classes parsing.
 
bhaskaritp naidu
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all,i whould like to say thanks to all for your quick reply.

i did that.

now i have one more problem.i split the data and store it in array of arraylist(each customer record as one arraylist in tht).

now i need to create a invoice based on the data available in that array of arraylist.

do we have any thing to do in java.

i need to create invoice for each customer as a text file.

i am not able to copy invoice format.
eg.is like our mobile bile.


how can we create that type of bill in java(formatted bill)


Thanks in advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic