Hello All
I have read over all of your comments, and I understand to an extent what you are saying. I am a lowly hacker trying to automate a report. Below is the updated code I have, but I am now getting a new error. Here is what I ultimately want to do, and if someone can point me to a straight forward source then I am happy to try as much on my own as I can.
I have a tabe delimited file. I want to eliminate rows where the date in column "Cust Late Shp Dt" is greater than today. Then I want to sort the data by the same field. Then save the data and put it back in the same location as I got it from. Below is the code that I have so far, but if I need to start completely over I will, just so I can get this done. Once I have the template and understand it, I think I can then apply it to several other reports. Thank you in advance for all of your help.
use strict;
use warnings;
use Win32::OLE;
use Date::Calc;
my ($f_mfg_desk, $f_mfg_desk_output, @wip_query, $opr_cd, @header,
%header_data, @row_array, $BREAK, $Oper_Cd, @newrow, $start_time);
# This gets the document from the server
$f_mfg_desk = '//163.10.50.33/planning/logistics/programs/chicago_wip_
+query.txt';
@header = ("Oper_Cd","Pick_Ref_Num","Part_Id","Lot Qty","Order Id",
"Order Lineitem Id","Order Lineline Id","Sublot Num",
"Comm Invoice Num","Oper In Dt","Cust Early Shp Dt",
"Cust Late Shp Dt","Current Date","Business Class Cd",
"Action Expedite Flg","Required Ship Saleable",
"Required Ship Inventory Transfer","Total Required Ships");
$start_time = time;
open (INFILE, '//163.10.50.33/planning/logistics/programs/chicago_wip_
+query.txt');
while (<INFILE>) {
chomp;
@newrow = spli
t /\t/;
$header_data{$newrow[2]} = [$newrow[3..18]];
}
close(INFILE)
Once I have this done I then have figured out the email functionality and several other items that I need. The actual manipulation of the document is what eludes me right now. I know I am just at the start, defining the variables and getting the header information read into the program, so I understand I have a long ways to go.
Oh, and I am using Activestate Komodo to write this program in, which is better than a free-ware I was using. Is this the best program for this type of activity, or is there one that is maybe a little more helpful in pointing out where an error is and how to fix it?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.