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

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

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

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

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

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

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

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

Windows 7 Professional x64
 
 

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

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

Windows 7 Pro x64 (1), Win7 Pro X64 / WinXP Pro x86 on (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 for2: About to start a new project & looking for advice
Thread Forum
Solved Resolving a start up problem. Advice needed General Discussion
New Gaming Project Gaming
Novice Overclocker advice. Where to start? PC Custom Builds and Overclocking
Help with Project 64 Gaming
New theme project! Themes and Styles
help with project General Discussion
Advice on creating new start orb Customization

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 09:38 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33