GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-May-2009, 21:14
aimann aimann is offline
New Member
 
Join Date: May 2009
Posts: 1
aimann is on a distinguished road

Partition a file on user input


hi all,
I need C++ program that read data from text file and partition it into specific number ,specified by the user.for example the user run the program,the program first will ask the user how many partition do you want ?after obtain the number of partitions ,the program will read the text file and show the partitions on the console and and the content of each partition.
thank you in advance
aiman
  #2  
Old 07-May-2009, 00:06
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,373
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: help needed!


Quote:
Originally Posted by aimann
hi all,
I need C++ program that read data from text file and partition it into specific number ,specified by the user.for example the user run the program,the program first will ask the user how many partition do you want ?after obtain the number of partitions ,the program will read the text file and show the partitions on the console and and the content of each partition.
thank you in advance
aiman
Try reading the Guidelines as requested.
__________________

The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
  #3  
Old 07-May-2009, 07:10
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 761
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: help needed!


Quote:
Originally Posted by aimann
hi all,
I need C++ program that read data from text file and partition it into specific number ,specified by the user.for example the user run the program,the program first will ask the user how many partition do you want ?after obtain the number of partitions ,the program will read the text file and show the partitions on the console and and the content of each partition.
thank you in advance
aiman
Let's see if I understand you correctly. If I enter the number 4 into your program, it will divide the text in the file into 4 equal parts to display separately? If that is the case, here is how I might go about it:

1) Open the file and count the number of characters.

2) Get the partition number from the user.

3) Calculate the partition size based on the character count and the partition number.

4) Reset the file to the beginning.

5) For each partition, read the correct number of characters from the file and print them to the screen.
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Program Needed: Perfect Number Program in C language koool_kid C Programming Language 13 22-Aug-2009 09:42
C++ games programmer needed (London, freelance contract) Nickdammit Computer Programming Advertisements & Offers 2 22-Dec-2008 14:01
help needed !!! haruka C Programming Language 3 13-Nov-2007 13:24
Free 1st month / Free setup / No credit card needed...Plans start at 4.95 LarryIsaac Web Hosting Advertisements & Offers 0 11-Oct-2003 14:03

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:04.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.