06-06-2009
Hi Devaraj
thanks for the reply...
Am getting error like ..
awk NR==1{ord=$5;del=$6;s=$4;print $0 > s ;getline}
$4 !~ s {print "--------" > s;print "total",ord,del > s ;s=$4;ord=0;del=0}
$4 ~ s {ord+=$5;del+=$6;print $0 > s ;s=$4;next}END{print "--------" > s;print "total",ord,del > s}
+ sort -k2,2 /ab/cd/item.dat
awk: A print or getline function must have a file name.
The input line number is 1.
The source line number is 1.
+ echo logout
logout
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear Guyz:)
I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z).
I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies
2. Shell Programming and Scripting
I have read another post about this issue and am wondering how to adapt it
to my own, much simpler, issue.
I have a file of user IDs like so:
333333
321321
546465
...etc
I need to take each number and use it to print records wherein the 5th
field matches the user ID pulled from the... (2 Replies)
Discussion started by: Bubnoff
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
My code works perfectly fine.
But, $my $min_to_add = 1 * 1 * 60; and my $hr_to_sub = 1 * 1 * 86400; i may need to change the values in future. so am keeping them in a separate configuration file like
MIN = 1 * 1 * 60
HR = 24 * 60 * 60
in the script, i use a package use et_config... (3 Replies)
Discussion started by: irudayaraj
3 Replies
4. Shell Programming and Scripting
Hi,
I have initailized a varaible EBID as typeset Long EBID=0
i am calculating value of EBID using certian formula as below:
(( CURR_EBID= ($BANDINDEX << 27) | ($CURR_FREQ << 16) | ($CURR_CELLID << 4) | $CURR_SECTOR_VALUE ))
return $CURR_EBID
The output is as below:
+ (( CURR_EBID=... (6 Replies)
Discussion started by: kasanur
6 Replies
5. Shell Programming and Scripting
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies
6. Shell Programming and Scripting
Hi everyone,
This is an exemple of inpout.txt file (a "," delimited text file which can be open as csv file):
ID, Code, Value, Store SP|01, AABBCDE, 15, 3 SP|01, AABBCDE, 14, 2 SP|01, AABBCDF, 13, 2 SP|01, AABBCDE, 16, 3 SP|02, AABBCED, 15, 2 SP|01, AABBCDF, 12, 3 SP|01, AABBCDD,... (1 Reply)
Discussion started by: jeremy589
1 Replies
7. Shell Programming and Scripting
Hi,
I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below...
if (start_new_rec=="true"){
exclude_user="false";
user=toupper($6);
match(user, "XXXXX.");
if (RSTART ==2 ) {
... (9 Replies)
Discussion started by: asandy1234
9 Replies
8. Shell Programming and Scripting
I am using the following script to search for and print minimum values for each individual Fields (3-14) for each unique id (Field 1). But when the field contains a "-99.99" ( I am ignoring "-99.99") and when the minimum value is the first line of a new id (Field 1), the output does not print Field... (13 Replies)
Discussion started by: ncwxpanther
13 Replies
LEARN ABOUT OSF1
crosspost
CROSSPOST(8) System Manager's Manual CROSSPOST(8)
NAME
crosspost - create the links for cross posted articles
SYNOPSIS
crosspost [ -D dir ] [ -s ] [ file... ]
DESCRIPTION
Crosspost reads group and article number data from files or standard input if none are specified. (A single dash in the file list means to
read standard input.) It uses this information to create the hard, or symbolic, links for cross posted articles. Crosspost is designed to
be used by InterNetNews to create the links as the articles come in. Normally innd creates the links but by having crosspost create the
links innd spends less time waiting for disk IO. In this mode one would start innd(8) using the ``-L'' flag.
Crosspost expects input in the form:
group.name/123 group2.name/456 group3.name/789
with one line per article. Any dots in the input are translated into "/" to translate the news group into a pathname. The first field is
assumed to be the name of an existing copy of the article. Crosspost will attempt to link all the subsequent entries to the first using
hard links if possible or symbolic links if that fails.
By default, crosspost processes its input as an INN channel feed written as a ``WR'' entry in the newsfeeds(5) file, for example:
crosspost:*:Tc,Ap,WR:/usr/lib/news/bin/crosspost
To process the history file and re-create all the links for all articles use:
awk <history -F' ' '(NF > 2){print $3}' | crosspost
(where the -F is followed by a tab character.)
The ``-D'' flag can be used to specify where the article spool is stored. The default directory is /var/spool/news.
By default crosspost will fsync(2) each article after updating the links. The ``-s'' flag can be used to prevent this.
HISTORY
Written by Jerry Aguirre <jerry@ATC.Olivetti.Com>.
SEE ALSO
newsfeeds(5), innd(8).
CROSSPOST(8)