hi plz help me...

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2009
Posts: 22
Reputation: Himani_29 is an unknown quantity at this point 
Solved Threads: 0
Himani_29 Himani_29 is offline Offline
Newbie Poster

hi plz help me...

 
0
  #1
Jul 9th, 2009
nw i hv been tryin a stuff tht m really nt sure if u guys understnd at once..bt sum1 hs to find a solution for it plzzzzzzzzzz...

i need a code in C++ to do the following tasks...:-

1.) copy files from a folder
2.) save them in a different location as text files
3.) the files r of two types .cap n .inf. so i wnt to search each of the .cap files...
4.) make a folder of the name of the number that is inside it n then put the respective .cap flie as well as .inf file in the folder...
5.) the number inside the .cap file helps me to make a folder of tht name as previously sd n thn put the respective .cap file in it also the name of the .cap file helps to search its respective .inf file n den add tht too in the folder.

NOTE:- the name of the .cap file has lst 6 alphanumeric characters of the serial number in the rspective .inf file...n its .inf file has the same name as the serial number inside it...

does sum1 make a solution for it..???
i m wrkin on DevC++
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 57
Reputation: emarshah is an unknown quantity at this point 
Solved Threads: 5
emarshah emarshah is offline Offline
Junior Poster in Training

Re: hi plz help me...

 
0
  #2
Jul 9th, 2009
Originally Posted by Himani_29 View Post
nw i hv been tryin a stuff tht m really nt sure if u guys understnd at once..bt sum1 hs to find a solution for it plzzzzzzzzzz...

i need a code in C++ to do the following tasks...:-

1.) copy files from a folder
2.) save them in a different location as text files
3.) the files r of two types .cap n .inf. so i wnt to search each of the .cap files...
4.) make a folder of the name of the number that is inside it n then put the respective .cap flie as well as .inf file in the folder...
5.) the number inside the .cap file helps me to make a folder of tht name as previously sd n thn put the respective .cap file in it also the name of the .cap file helps to search its respective .inf file n den add tht too in the folder.

NOTE:- the name of the .cap file has lst 6 alphanumeric characters of the serial number in the rspective .inf file...n its .inf file has the same name as the serial number inside it...

does sum1 make a solution for it..???
i m wrkin on DevC++
Hello Himani,
I think you are in wrong place, here people don't solve your assignments or requirements... If you have some particular error or problem, then i assure you people will help you. Hope you will do it yourself if you try little hard.Thanks
Syed Ammar Hassan
" A man is known by his level of Determinism "
--------------------------------------------------------
"Some cause happiness where ever they go, others whenever They go"
--------------------------XIII---------------------------
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 22
Reputation: Himani_29 is an unknown quantity at this point 
Solved Threads: 0
Himani_29 Himani_29 is offline Offline
Newbie Poster

Re: hi plz help me...

 
0
  #3
Jul 9th, 2009
Originally Posted by emarshah View Post
Hello Himani,
I think you are in wrong place, here people don't solve your assignments or requirements... If you have some particular error or problem, then i assure you people will help you. Hope you will do it yourself if you try little hard.Thanks
listen dear i need hlp n tht s clear..if u cnt hlp fine...
bt mayb dere s sum1 around who cn actually pose hlp..
thnku..
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,406
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1467
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: hi plz help me...

 
0
  #4
Jul 9th, 2009
Originally Posted by Himani_29 View Post
does sum1 make a solution for it..???
i m wrkin on DevC++
No. We do not write your program for you, but we will help you write it yourself. Show us some effort, such as post the code you have tried, and ask specific questions about your code. But do no expect anyone here to do your homework for you, that's your job, not ours.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 22
Reputation: Himani_29 is an unknown quantity at this point 
Solved Threads: 0
Himani_29 Himani_29 is offline Offline
Newbie Poster

Re: hi plz help me...

 
0
  #5
Jul 9th, 2009
i very well knw tht..
n first plz if u cn stp being tht rude..

i hv been successful in making the code tht helps me do the complete task bt for a single file...
nw hw do i manage to gt all the files n do the searches..??
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 22
Reputation: Himani_29 is an unknown quantity at this point 
Solved Threads: 0
Himani_29 Himani_29 is offline Offline
Newbie Poster

Re: hi plz help me...

 
0
  #6
Jul 9th, 2009
  1. #include<fstream>
  2. #include<stdio.h>
  3. #include<iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. char c,c1,c2,c3,c4,c5,c6,c7;
  8. char PLO[16],fn1[50],fn2[50],cmd[50];
  9. c1=c2=c3=c4=c5=c6=c7=0;
  10. int flag=1;
  11. ifstream fin,gin;
  12. ofstream f1,f2;
  13. fin.open("2100DC.cap",ios::in);
  14. if(!fin)
  15. cout<<"Cannot open file"<<endl;
  16. while(fin&&flag)
  17. {
  18. c7=c6;
  19. c6=c5;
  20. c5=c4;
  21. c4=c3;
  22. c3=c2;
  23. c2=c1;
  24. fin.get(c1);
  25. //cout<<c6<<c5<<c4<<c3<<c2<<c1;
  26. if((c6=='<')&&(c6=='<')&&(c5=='O')&&(c4=='R')&&(c3=='D')&&(c2=='E')&&(c1=='R'))
  27. flag=0;
  28. }
  29. int count=0;
  30. fin.get(c);
  31. c='1';
  32. while(c!='<')
  33. {
  34. fin.get(c);
  35. if(c!='<')
  36. PLO[count++]=c;
  37. };
  38. PLO[count]='\0';
  39. fin.close();
  40. cout<<"The PLO number is "<<endl;
  41. for(int i=0;i<count;i++)
  42. cout<<PLO[i];
  43. cout<<endl;
  44. sprintf(cmd,"mkdir %s",PLO);
  45. system(cmd);
  46. sprintf(cmd,"cd %s",PLO);
  47. system(cmd);
  48. sprintf(fn1,"%s/%s.cap",PLO,PLO);
  49. f1.open(fn1,ios::out);
  50. gin.open("INA92100DC.inf",ios::in);
  51. sprintf(fn2,"%s/%s.inf",PLO,PLO);
  52. f2.open(fn2,ios::out);
  53. while(gin)
  54. {
  55. gin.get(c);
  56. f2.put(c);
  57. }
  58. fin.open("2100DC.cap",ios::in);
  59. while(fin)
  60. {
  61. fin.get(c);
  62. f1.put(c);
  63. }
  64. system("PAUSE");
  65. }

tht s it...
Last edited by Ancient Dragon; Jul 9th, 2009 at 5:31 am. Reason: add code tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,406
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1467
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: hi plz help me...

 
0
  #7
Jul 9th, 2009
It would be helpful if you posted the contents of that *.cap file. The code you have posted is a bit confusing to follow, so knowing the file contents will help us help you.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 22
Reputation: Himani_29 is an unknown quantity at this point 
Solved Threads: 0
Himani_29 Himani_29 is offline Offline
Newbie Poster

Re: hi plz help me...

 
0
  #8
Jul 9th, 2009
even after posting the code if none can help..well fine then..

anyways thanks...
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 22
Reputation: Himani_29 is an unknown quantity at this point 
Solved Threads: 0
Himani_29 Himani_29 is offline Offline
Newbie Poster

Re: hi plz help me...

 
0
  #9
Jul 9th, 2009
yes certainly i understand that it may be a problem to understand it...
but i cannot post the complete file in here..
the only thing that i can do is to copy the first line of the file as it will help you know that which name folder is being made...
<YUPS><SENDER>SDV</SENDER><SN>INA92100DC</SN><ORDER>00410739270100</ORDER>

now the number after <order> is what i have to make use of...
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 22
Reputation: Himani_29 is an unknown quantity at this point 
Solved Threads: 0
Himani_29 Himani_29 is offline Offline
Newbie Poster

Re: hi plz help me...

 
0
  #10
Jul 9th, 2009
with the code above i was able to create a folder with the name 00410739270100 as required and add the .cap file and .inf files to it but the problem as you might have observed is that first i am actually reading the files manually and secondary when the files are added to the folder the lose their name and take up the name of the folder with their extensions...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC