Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Jul 25th, 2005, 4:24 PM   #1
cdeep
Newbie
 
Join Date: Jul 2005
Posts: 2
Rep Power: 0 cdeep is on a distinguished road
Working with Notepad

Hello all,

I'm new to the forum and pretty new to programming too. I'm trying to work on a problem that is pretty difficult for me. Hope one of you guys can help me.

Here's what I'm trying to do - I have a list of words in an excel sheet. I'd like to open an existing text file and compare the list of words (in excel) with the words in the notepad file and prompt if there is a word that does not match with any word in the list. I know how to open a notepad file and other basic stuff. any help will be appreciated. Thanks!
cdeep is offline   Reply With Quote
Old Jul 25th, 2005, 4:33 PM   #2
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,650
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
Are you creating this with VBA? or in other words the visual basic that is built into excel? or with just plain old normal VB?

edit: Just so you know its not really working with notepad. you will end up reading the plain text file(or as you called it Notepad file) and reading it into the program.
here is a quick search on reading in text files into vba
http://www.google.com/search?hs=HZU&...le&btnG=Search

here is a quick search on reading in text files into vb6
http://www.google.com/search?hs=PZU&...le&btnG=Search

just let me know which of the 2 you are using and i will get back to helping you more
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Jul 25th, 2005, 6:38 PM   #3
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
Make the plain text file tab-delimited and then export the excel file as a tab-delimited text file and just parse through the files simultaneously comparing each token as you go.
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2
skuinders is offline   Reply With Quote
Old Jul 26th, 2005, 7:14 AM   #4
cdeep
Newbie
 
Join Date: Jul 2005
Posts: 2
Rep Power: 0 cdeep is on a distinguished road
BigK and Skuinders - Thanks for the reply. sorry I could not get back earlier - I currently have computer access only at my office. BigK, I'm using VBA with Excel. I checked out the links and I'm going to try to do what it says. MEanwhile, it'd be of great help if you can help me out with the actual comparison part. I cannot think of anything other than sequentially checking every single word and since the text file is pretty large I'm worried about the time. Skuinders, I can visualize what you are saying but I'm pretty sure I cannot translate it into code.
cdeep is offline   Reply With Quote
Old Jul 26th, 2005, 10:22 AM   #5
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
you might be able to do the search useing regular experssions, if VBA has them.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Jul 26th, 2005, 10:41 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
What skuinders is saying is that you can export the excel file as a text file. This means you don't have to understand the way VBA is used specifically for excel (as a macro language, so to speak). Obviously you have to look at every word. How else can you make a judgement about it? Just sort both files. Pick a word from file A. If the next word in file B is "greater", then the A word is not in File B. If it's not "greater", then continue to read from file A until you find a word in file B which is "equal" or "less". You see the drill.
__________________
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 Jul 26th, 2005, 10:50 AM   #7
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Do untill loops work great for this IMHO.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios 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 4:55 PM.

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