Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: About to start a new project & looking for advice

04 Jun 2011   #1
McP2143

Windows 7 Home Premium 64bit.
 
 
About to start a new project & looking for advice

I work at a lumber yard and I have a bunch of text files (called pick lists) that start with about twenty to forty lines of pointlessness then gets to the data needed. It looks like this:
1,2x4,16',2100
2,2x4,14',#2
3,2x6,12',#2
1,2x4,10',#2
1,2x4,16',2100
2,2x4,14',#2
1,2x4,10',#2
3,2x6,12',#2
3,2x6,12',#2
......
QTY,SIZE,LENGTH,GRADE
I'm the guy that gets handed this printout and gets to count all this out (they are much longer like 2-3 pgs.) I know I can write something, somewhere to sort through these files and just print out the added QTY of each instance of similar size, length & grade. I just don't know where to start.
Thanks for any input


My System SpecsSystem Spec
.
04 Jun 2011   #2
BriceH

Windows 7 Professional x64
 
 

This could be done fairly easily with a Python script. I would be happy to write it for you, but I am extremely low on time right now. If you don't need it before June 10th, I can write it for you.
My System SpecsSystem Spec
04 Jun 2011   #3
McP2143

Windows 7 Home Premium 64bit.
 
 

Wow I didn't expect an offer to write it for me!! Thank you Brice. Waiting is not an issue at all. I was planning on teaching myself some lessons in code as I assumed this would be fairly easy. I will get a few of the full files and post them here Monday night after work.
My System SpecsSystem Spec
.

04 Jun 2011   #4
BriceH

Windows 7 Professional x64
 
 

No problem. Just PM me around June 9th or June 10th. It won't take too long and will be really good practice for me.
My System SpecsSystem Spec
04 Jun 2011   #5
BriceH

Windows 7 Professional x64
 
 

Can you tell me what you'd like the program to display for the sample you posted above?
My System SpecsSystem Spec
05 Jun 2011   #6
BriceH

Windows 7 Professional x64
 
 

I just finished the script. I have attached it and a sample data file. This is how it would work for the sample data you gave me above. (The file Sample Data.txt must be in the same folder as this Python script.)
Code:
Please enter the path to a data file: Sample Data.txt
Size Quantities:
 2x4: 8
 2x6: 9
Length Quantities:
 14': 4
 16': 2
 10': 2
 12': 9
Grade Quantities:
 #2: 15
 2100: 2
By the way, you must install Python before using this script. To do so, please click here and you will download the 64-bit version.


Attached Files
File Type: zip Lumber Yard Data Processor.zip (843 Bytes, 0 views)
My System SpecsSystem Spec
05 Jun 2011   #7
McP2143

Windows 7 Home Premium 64bit.
 
 

Quote:
1,2x4,16',2100
2,2x4,14',#2
3,2x6,12',#2
1,2x4,10',#2
1,2x4,16',2100
2,2x4,14',#2
1,2x4,10',#2
3,2x6,12',#2
3,2x6,12',#2
......
for this example an output would be

9,2x6,12',#2
2,2x4,10',#2
4,2x4,14',#2
2,2x4,16',2100

This is a trimmed down example the real deal has many different lengths, sizes, and grades. I would also like any output of this to be in a new file. Thanks again.
My System SpecsSystem Spec
05 Jun 2011   #8
BriceH

Windows 7 Professional x64
 
 

Oh, okay. I'll make some modifications to it to do that.
My System SpecsSystem Spec
05 Jun 2011   #9
BriceH

Windows 7 Professional x64
 
 

I have now modified it to do everything you want, including putting the output in a new file. Please report back on how well this works, and please rep me if you find it useful. Thanks.

IMPORTANT: Make sure to extract the zip file before using the script.


Attached Files
File Type: zip Lumber Yard Data Processor.zip (787 Bytes, 6 views)
My System SpecsSystem Spec
05 Jun 2011   #10
dsperber

Windows 7 Pro x64 (1), Win7 Pro X64 (2)
 
 

Quote   Quote: Originally Posted by BriceH View Post
I have now modified it to do everything you want, including putting the output in a new file. Please report back on how well this works.
Seems to work exactly as expected. Very nice.

Since the input TXT file is clearly in a CSV (comma-separated variable) format that is suitable for importing into Excel, it also would seem that a spreadsheet solution with a simple SUM/DSUM function of some kind should also exist... since the data is already prepared and it's just a matter of adding the values in cells from one column based on matching cells in other columns being the criteria.

Give me one day.

(very simple COBOL program as well)
My System SpecsSystem Spec
Reply

 About to start a new project & looking for advice




Thread Tools




Similar help and support threads
Thread Forum
Resolving a start up problem. Advice needed
Hi, This is my first posting so hello to All and apologies if this is in the wrong section. I have a rather odd problem with an HP Pavilion G6 laptop, with Windows 7 Home Premium edition. When starting up it sometimes hangs after the windows logo, turns to a black screen with cursor only and...
General Discussion
Novice Overclocker advice. Where to start?
Hello, I'm interested in overclocking my FX 8150 but I dont want to start without some advice. If my system will handle it where would i start? any help appreciated My specs: AsRock 970 extreme3 AMD FX-8150 Corsair cmx8gx3m2a1333c9 8gb (4x2) Corsair TX750 PSU Asus 6950 DCII 2gb GPU
PC Custom Builds and Overclocking
New theme project!
So I just decided to take on a daunting new project: This new project is the MAC OSX theme. (for the purpose of this screenshot--which went on Facebook as well, in my "computer stuff" picture journal--I disabled the transparency, but just know I do have glass transparency on the window shells) ...
Themes and Styles
help with project
I have to do a project for my computer literacy class, and it requires Windows XP. All that I have access to is Windows 7. Is there any way to get an interactive XP interface on my Windows 7 laptop?
General Discussion
Advice on creating new start orb
Morning all, i want to make it my task for the day to create a new start orb, i have bee watching lots of vids on youtube as well as reading the tut on here but must admit it sounds kinda confusing. I dont actually have photoshop and was wondering if it was possible to use a different app. Im...
Customization
Help With my HTML Project ;)
Im just learning basic HTML, and this is my first year - and i need some help with my project!! Here is my code so-far: But I left space in between the <script language=JavaScript> and the </script> tags for my variables. Thats really all i dont kno how to do :P <html> <head> <!--MADE...
Chillout Room


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:08.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App