Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2008, 10:40 AM
Member
 
Join Date: Jul 2008
Posts: 5
adarsh_2484 is on a distinguished road
Can any one help me?
I am new to java.I have a text file in the server(containing the account information of account holders).It is a long file without any delimiters between to separate different types of data namely account no:,name etc. .I have to download that file to the client and convert it into the format given below.

"
char AccNo[12];
char Name[18];
unsigned long AvailableBalance;
unsigned char AccType[5];
date LastCollectedDate;
unsigned char Reserve[21]; /*for size 64 */
"

How can I do that.Please help me by sending a sample code.



I think I can create a class having data variables
"
char AccNo[12];
char Name[18];
unsigned long AvailableBalance;
unsigned char AccType[5];
date LastCollectedDate;
unsigned char Reserve[21]; /*for size 64 */
"
I do not no how to proceed.Please help me.

Last edited by adarsh_2484 : 07-24-2008 at 01:33 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2008, 11:16 AM
Senior Member
 
Join Date: Jun 2008
Posts: 469
masijade is on a distinguished road
No. Show us your code and we will help you correct it, but we are not going to do it for you.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-24-2008, 11:23 AM
Alan-LB's Avatar
Member
 
Join Date: Jun 2008
Location: Junee, NSW, Australia
Posts: 19
Alan-LB is on a distinguished road
Send a message via Yahoo to Alan-LB
Could be a problem if there really are no field delimiters. The fields must then be of fixed length - as he has indicated - particularly for the name.

Yet another "very urgent" request - why is it so?

Alan
__________________
There are 10 types of people - those who understand binary and those who don't!!
Today is the Beta version of Tomorrow!!
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-25-2008, 11:21 AM
Member
 
Join Date: Jul 2008
Posts: 5
adarsh_2484 is on a distinguished road
Please Help me
Herewith I am attaching my code, for downloading a text file from the server ,along with this message.But It is not working.Please help me to rectify it.

With Regards
Adarsh
Attached Files
File Type: txt DownServlet.txt (2.9 KB, 2 views)
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-25-2008, 05:48 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
Norm is on a distinguished road
What is NOT working? Could you explain a bit more. There are a lot of ways for a program to NOT work.
If you are having problems with the reading/writing, write a small standalone program to get your code to work.
Quote:
download that file to the client and convert it
I don't see any conversion code! Your code appears to just copy from input to output. Is that what your code is supposed to do?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 07-25-2008, 06:06 PM
Senior Member
 
Join Date: Jun 2008
Posts: 469
masijade is on a distinguished road
What does "it doesn't work" mean?

Does it not compile? If not provide the complete compiler message.

Doe it throw an exception when you run it? If so, provide the complete stacktraces to the errors.

Does it do something you don't expect? If so, what, exactly, does it do, and why do you believe that to be unexpected.

Does it not do something that you want it to do? If so, describe exactly what it is was suppossed to do, and what it actually did.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +3. The time now is 01:28 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org