Python Forum
Grouping lots of words in lots of txt files: programmer needed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grouping lots of words in lots of txt files: programmer needed
#1
I wasn't too sure where to put this, so I went for off-topic. Sorry if that's not the spot.

As you might be able to tell from the title...I'm not really a programmer. But I do need some programming to be done. I think that this is a task that should take less than a hour for pretty much any person who knows python programming well (maybe I'm wrong though), so instead of investing hours and hours in learning a programming language, I thought I might just, you know, knock at the door.

What I want to do is fairly simple, but the motivations might seem random, esoteric, or...anything. 
I don't want to talk about it as that would involve explaining things for ages and could start a heated discussion that might turn to crap, so please...
I just need some bit of code, or rather, a product coming from said code, and that's it... So please, if anyone would be so kind as to do this task...I, well, I'd be really happy.

To get to the point...
I have a text file (the kind that you open with notepad) of over a hundred thousand English and not-so English words. For each line there is only one word.
The word list should be available there. Be careful, Dropbox might lag a little (or maybe my computer's hard disk drive is a bit slow):

https://www.dropbox.com/s/8s2dt08f6wp7us...s.txt?dl=0

(Please report to me if this link does not work)

For the code, each letter from A to Z must have a numerical value associated to it, like this: 
A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 10, K = 11, L = 12, M = 13,
N = 14, O = 15, P = 16, Q = 17, R = 18, S = 19, T = 20, U = 21, V = 22, W = 23, X = 24, Y = 25, Z = 26
Any character that isn't a letter must have a value of zero, EVEN the numbers from 0 to 9, if there are any.


So, what the code needs to do is:
1.Read one line of the text file at a time (starting with the first one)

2.Calculate the combined value of the letters in that line (example: if the word on that line is "cake", do C+A+K+E, aka 3+1+11+5, which gives 20)

3.In a folder called "WordListsFolder" (or whatever you wanna call it really, as long as it's not offensive):
-create a text file called after the value of the word in question (in the above example, call the file "20", and write the calculated word on the first line;
-if a text file with the same name (as the value of the word) already exists, use that text file instead of creating a new one;
-if there are already words in the text file that we want to write a word into, place the calculated word on an empty line directly under all the already taken lines.

4.Once a line has been read, the characters on that line summed, and the word(s) of the line added to a correspondingly named text file, 
repeat steps 1, 2, and 3 with the next line in the file. 
Do this until there are no more lines left to calculate.

Words that are added to the text files must be written in UPPER CASE letters, since I might add notes in lower case letters to the text files later on. 
This distinction of upper case and lower case letters will help me to distinguish the data from the notes despite the limited capabilities of a txt file. 
I want to use txt files mainly because they are lightweight and are quick to open, and it's easy to compare two or more txt files next to one another.

While I want the words to be classed alphabetically, you won't need to do code for that, as the words in the file I provided are already classed alphabetically, which means that if its lines are read from top to bottom, the words should be automatically classed alphabetically in each individually produced text files, without any code involved to ensure that. That is, if my logic is right.





Once the program has done its job and produced all that was required, please give me access to the folder containing the text files, be it by Dropbox or anything else that works. I couldn't thank enough whoever does complete my request.

Make sure that your code has worked properly though, by taking a sample of words in some of the produced files, to see if it they correspond to the name of those files.

The hierarchy of the "WordListsFolder" folder should resemble this:
WordListsFolder >
1.txt
2.txt
3.txt
4.txt
...
Idontknowwhatnumber.txt

and the content of the text files should look like this (taking, for example, the text file called 20):
AS
CAGED
CAKE
CAP
DIG
FEED
JADE
(etc. (this is just an example, I don't know which words would show up first in that text file))

By the way, I'll be using the Courier New font when working with the files, for a few reasons. So if you want to see how I would see the files, you should use that font in Notepad.




Now I can't think of anything else to say...oh yes, to get you started, the infos in this page might be helpful:
http://stackoverflow.com/questions/31224...and-values

Heck, maybe I should have just used that.. But why, oh why, would I force myself into learning coding when I just need one task done, and tens of thousands can do that task blindfolded. I don't see any foreseeable future involving me being a programmer in anything, too. I do enjoy logic problems but I still don't feel that coding is my vocation...So I hope you understand my lack of motivation.

Sorry for posting on a programming forum while simultaneously not wanting to program...I know, it feels bad and inappropriate. But I can't think of anything else to do right now.





If anything is not clear about the task, I'll gladly reformulate what lacks clarity.

As for sharing the code or making a small program out of it that could be used by anyone...Well, that's out of the scope of the present request, but if you feel like doing it it certainly would be appreciated. It's not required though. All I need now is what the code creates.

Thanks in advance.
Reply


Messages In This Thread
Grouping lots of words in lots of txt files: programmer needed - by HexagonalRocketry - Mar-07-2017, 01:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Programmer looking for work Johndg20 1 2,335 Sep-12-2021, 01:21 PM
Last Post: Larz60+
  programmer for my project siliconvalleymusicbrokerscom 1 3,000 Feb-01-2018, 07:51 AM
Last Post: PythonMagic003
  Python programmer needed to integrate GUI in Linux/LinuxCNC blazini36 1 4,312 Aug-18-2017, 03:32 PM
Last Post: victor_cis
  Need hired help from python programmer oj43085 6 6,448 May-10-2017, 06:06 PM
Last Post: nilamo
  Summer programmer needed to teach camp Tampa, Florida MOSI MOSI 0 3,122 Apr-18-2017, 04:55 PM
Last Post: MOSI

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020