- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Output formatting
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2003 09:50 AM
тАО09-29-2003 09:50 AM
Output formatting
Please help. Very urgent.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2003 11:18 AM
тАО09-29-2003 11:18 AM
Re: Output formatting
2SUM=0
3SUM=0
cat FILE | while read DEPT DATE CUST RES
do
case $DEPT in
DEPT1) 1SUM=$(($1SUM+1));;
DEPT2) 2SUM=$(($2SUM+1));;
DEPT3) 3SUM=$(($3SUM+1));;
esac
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2003 07:23 PM
тАО09-29-2003 07:23 PM
Re: Output formatting
I'd like to help, this should be trivial since you have only 1 table, but you don't give enough information.
What is a "recent 2 contact", likewise 5 and 3 ??
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 12:34 AM
тАО09-30-2003 12:34 AM
Re: Output formatting
if the "recent contacts" are those in your original input file, then try running the attached script with your input file as $1.
If not, please explain "recent".
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 03:45 AM
тАО09-30-2003 03:45 AM
Re: Output formatting
anyway.....let me explain more clearly....
Yes i have all details in one single database table.
Attached document with more details...hope i'm making myself clear....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 05:06 AM
тАО09-30-2003 05:06 AM
Re: Output formatting
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 05:38 AM
тАО09-30-2003 05:38 AM
Re: Output formatting
%numhold=("DEPT1",1,"DEPT2",4,"DEPT3",2);
while(
chomp;
($dept,$date,$cust,$rslt)=split('\s+',$_);
($m,$d,$y)=split("/",$date); $y+=$y < 10 ? 2000 : 1900;
$ymd="$y/$m/$d";
$datum=$hold{$cust}{$dept};
$datum=[] unless $datum;
push(@{$datum},$ymd . "+" . $rslt);
@{$datum}=(reverse sort @{$datum})[0..$numhold{$dept}];
$hold{$cust}{$dept}=$datum;
}
foreach $cust (sort keys %hold) {
print $cust;
foreach $dept ("DEPT1","DEPT2","DEPT3") {
print "+$dept";
foreach $datex (1..$numhold{$dept}) {
print "+$hold{$cust}{$dept}[$datex]";
}
}
print "\n";
}
The date format will be re-arranged to Y/M/D format (easier for sorts).
To run-
perl thisscript
This script also has the benefits if a customer lets say only has 1 contact to DEPT1, then the second contact data will be still have a place holder.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 05:46 AM
тАО09-30-2003 05:46 AM
Re: Output formatting
If the data you are processing is in an Oracle DB (or any other DB), then perl can access the DB directly without the need of an export file.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 06:28 AM
тАО09-30-2003 06:28 AM
Re: Output formatting
I can either use Oracle procedure for this or unix shell script. I cannot use pearl script or others.
Thanks
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 06:30 AM
тАО09-30-2003 06:30 AM
Re: Output formatting
The script above is assuming a flat text file to process.
-- Rod Hills