•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Legacy and Other Languages section within the Software Development category of DaniWeb, a massive community of 423,502 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,694 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Legacy and Other Languages advertiser: Programming Forums
Views: 1196 | Replies: 2 | Solved
![]() |
•
•
Join Date: Apr 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
I am trying to make a program that will take a list of words from a .txt file and add the alphabet to the end of each word.
the code i have just makes it read and re-read the first line. since each list will be different i cant just do
the way i want to have it read is to get the first line, add a,b,c,d etc... to the end then goto the next line.
This is my code i have to get from file
im forgetting the add suffix for the moment as i know how to do that
can someone help me please. the procedure to get the files id alpha-get.
any help with higher order procedures that might do what i need would be great
the code i have just makes it read and re-read the first line. since each list will be different i cant just do
(read-line) (read-line) (read-line) etc.... because each list will have different amounts of lines
the way i want to have it read is to get the first line, add a,b,c,d etc... to the end then goto the next line.
This is my code i have to get from file
(define (adder path)
(alpha-get "test.txt"))
(define (alpha)
0)
(define (alpha-get dir)
(set! alpha
(list (with-input-from-file dir
(lambda ()
(list
(read-line))))))
(begin
(display alpha)
(alpha-get "readsme.txt")))im forgetting the add suffix for the moment as i know how to do that
can someone help me please. the procedure to get the files id alpha-get.
any help with higher order procedures that might do what i need would be great
Last edited by captainhair : Jun 12th, 2008 at 4:50 am.
•
•
Join Date: Feb 2008
Posts: 12
Reputation:
Rep Power: 1
Solved Threads: 1
I'm not competent enough in scheme to provide much help, but it might be easier to read in the whole file, split it into lines, add the alphabet, and then print it all back to the file.
On the other hand.
If you put "dir" outside of the recursion, it might work.
Hmm... I don't have time to show you the code I'm thinking at the moment... tonight!
Anyway, if you use a letrec inside of alpha-get, so you don't use dir as part of the recursive call, each read-line should get the next line in the file.
On the other hand.
If you put "dir" outside of the recursion, it might work.
Hmm... I don't have time to show you the code I'm thinking at the moment... tonight!
Anyway, if you use a letrec inside of alpha-get, so you don't use dir as part of the recursive call, each read-line should get the next line in the file.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Legacy and Other Languages Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Need Help >> I Give Up , Cant Do This Program :'((( (Java)
- Read XML File in C/C++ (C++)
- Random Salary (Java)
- how to read a text file backwards? (C)
- Encrypt File using User Supplied Password (VB.NET)
- Word Count in Scheme (Computer Science and Software Design)
- wireless conection problem (Networking Hardware Configuration)
- How do you apply/use the OSI MODEL? (Networking Hardware Configuration)
- hover over text tips (JavaScript / DHTML / AJAX)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Creating .EXE's in Smalltalk/Squeak
- Next Thread: HELPPPPPPPP, Need to know about Windows XP and QuickBasic USB printer driver access


Linear Mode