Don,
Many many thanks Don for your detailed explaining. Excuse my lack of knowledge on this. I have couple of questions ---
1. what is
in this script?
I don't know how to be much clearer than the comment I made before on this:
Quote:
Originally Posted by Indra2011
2. what is this this logic for
in terms of real input file?
Sorry to bother you again on this
Thanks
With your sample file, there are three distinct values in the 1st field: 100, 200, and 300 so c will be set to the line number in the input file that contained the last one of these the 1st time it was seen (which is the 300 on line 3). Since c is 3, the actions in this section will be performed on lines 3, 6, 9, 12, ... (i.e., each time three lines have been read) which gives you a complete line of output to print after reading 3 input lines.
This User Gave Thanks to Don Cragun For This Post:
I don't know how to be much clearer than the comment I made before on this:
With your sample file, there are three distinct values in the 1st field: 100, 200, and 300 so c will be set to the line number in the input file that contained the last one of these the 1st time it was seen (which is the 300 on line 3). Since c is 3, the actions in this section will be performed on lines 3, 6, 9, 12, ... (i.e., each time three lines have been read) which gives you a complete line of output to print after reading 3 input lines.
Hi Friends,
I have a single column data like below.
1
2
3
4
5
I need the output like below.
0
1
2
3
4
where each row (including first row) subtracting from first row and the result should print below like the way shown in output file.
Thanks
Sid (11 Replies)
Hi, Please read the whole thread.
I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well.
example:
PACKET DATA PROTOCOL CONTEXT DATA
APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID
10 ... (6 Replies)
Hello,
I have an input file like the following:
11_3_4
2_1_35
3_15__
_16989
Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)