Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 24th, 2005, 6:10 PM   #1
zero771
Programmer
 
Join Date: Nov 2005
Posts: 37
Rep Power: 0 zero771 is an unknown quantity at this point
can someone make a program for me?

i dont care what programming language, but i need a program that checks every line in one text file with every line in another text file starting from a certain line on both. so that would make the line for each text file a user input thing and the text file itself would be user input with help of the "browse..." button that i see all the time.
will someone plz program that for me?
zero771 is offline   Reply With Quote
Old Nov 24th, 2005, 6:14 PM   #2
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
Correct me if im wrong, but shouldn't you be posting here?

Job Offers

BTW, ill see if i can do it.. it will be a console program though so you would input text to the console, if you dont mind of course.. but its free so you wont mind will you?
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old Nov 24th, 2005, 6:18 PM   #3
zero771
Programmer
 
Join Date: Nov 2005
Posts: 37
Rep Power: 0 zero771 is an unknown quantity at this point
>.> i dont know lol so i guess i dont mind
thank you for your help
zero771 is offline   Reply With Quote
Old Nov 24th, 2005, 6:21 PM   #4
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
Quote:
Originally Posted by zero771
i dont care what programming language, but i need a program that checks every line in one text file with every line in another text file starting from a certain line on both. so that would make the line for each text file a user input thing and the text file itself would be user input with help of the "browse..." button that i see all the time.
will someone plz program that for me?
what is your operating system? If it is a *nix you could use diff - the only thing is im not sure if you can specify from a specific line to another specific line. And what do you want it to check for? To see if they are different? If you just want to know if the two files are different you could use cmp.
linuxpimp20 is offline   Reply With Quote
Old Nov 24th, 2005, 6:24 PM   #5
zero771
Programmer
 
Join Date: Nov 2005
Posts: 37
Rep Power: 0 zero771 is an unknown quantity at this point
well you know if you download hosts files, and say you download it from different sources
you dont want the new hosts file to overwrite all the lines from the other files
so i want a program that takes the first host file (and i'd be saving both as txt files to save the programmer time) and takes say the first line scans it with the second text file, all lines to see if it is there, and then if it is not there it would add it to the second text file
and im on windows xp
zero771 is offline   Reply With Quote
Old Nov 24th, 2005, 6:33 PM   #6
zero771
Programmer
 
Join Date: Nov 2005
Posts: 37
Rep Power: 0 zero771 is an unknown quantity at this point
can that be done?
zero771 is offline   Reply With Quote
Old Nov 24th, 2005, 6:38 PM   #7
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
im thinking about how it could be done, but im only about 3 weeks into programming so i dont know if its do-able in my position and with the knowledge i have. What im thinking about doing is letting you input the specific text to look for in one file, then it will compare it to another file (you will be asked the 2 files to compare) but i first have to find out how its possible to search using C++.. might take a little while because im also trying to finish something right now.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old Nov 24th, 2005, 6:42 PM   #8
zero771
Programmer
 
Join Date: Nov 2005
Posts: 37
Rep Power: 0 zero771 is an unknown quantity at this point
well see if u have it so that its one specific line of text that u input into the program
then i have to compare ... more than 100 lines every time >.> a hosts file is also in alphabetic order so if i compared it manually it would prolly go faster...

edit:
sry if its too hard u can take ur time in making it since i myself cant do it
zero771 is offline   Reply With Quote
Old Nov 24th, 2005, 7:17 PM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Why the hell don't you just sort and merge the two files, shucking duplicates as you go. And get the hell into the Job Offers forum where you belong. It isn't real hard to figure out what the title of that forum means.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 24th, 2005, 8:26 PM   #10
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 294
Rep Power: 3 andro is on a distinguished road
Send a message via AIM to andro
sort file1 file2 | uniq > merged
andro is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:34 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC