I want row1 need to be subtracted from all rows including row itself.
I need the following operation to be done.
(Row1-Row1)
(Row2-Row1)
(Row3-Row1)
...
So on..
The script "awk '$1--{print}'" is not giving correct output.
For the input of
I got the output as
which is not correct..
Can you please modify the script to match requirement.
Thanks
Sidda
Last edited by Scrutinizer; 04-04-2012 at 02:39 PM..
Reason: Code tags
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)
I have a requirement in which i have to read a file which has multiple columns seperated by a pipe "|" from this i have to read each column values seperately and create a comma seperated row for the column and write to another file.
eg:
Input file:
ColA ColB
1 2
2 x
3 y... (5 Replies)
Hi,
I have a table in Db2 with data say
id_1 phase1
id_1 phase2
id_1 phase3
id_2 phase1
id_2 phase2
I need to concatenate the values like
id_1 phase1,phase2,phase3
id_2 phase1,phase2
I tried recursive query but in vain as the length of string to be concatenated in quite long. ... (17 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)
I am a newbie to shell scripting ..
I have a .csv file. It has 1000 some rows and about 7 columns...
but before I insert this data to a table I have to parse it and clean it ..basing on the value of the first column..which a string of phone number type...
example below..
column 1 ... (2 Replies)
Hi,
Can anyone suggest quick way to get desired output?
Sample input file content:
A 12 9
A -0.3 2.3
B 1.0 -4
C 34 1000
C -111 900
C 99 0.09
Output required:
A 12 9 -0.3 2.3
B 1.0 -4
C 34 1000 -111 900 99 0.09
Thanks (3 Replies)
Hi! Is there a way to append column and row header to a file in awk script.
For example if I have
Jane F 39 manager
Carlos M 40 system administrator
Sam F 20 programmer
and I want it to be
# name gend age occup
1 Jane F 39 manager
2 Carlos M ... (4 Replies)
Hi ALL,
We have requirement in a file, i have multiple rows.
Example below:
Input file rows
01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212
01,1,102319,0,1,80,20,U,1,241,00000059420000006021
I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies
LEARN ABOUT PHP
fbsql_fetch_array
FBSQL_FETCH_ARRAY(3) 1 FBSQL_FETCH_ARRAY(3)fbsql_fetch_array - Fetch a result row as an associative array, a numeric array, or bothSYNOPSIS
array fbsql_fetch_array (resource $result, [int $result_type])
DESCRIPTION fbsql_fetch_array(3) is a combination of fbsql_fetch_row(3) and fbsql_fetch_assoc(3).
An important thing to note is that using fbsql_fetch_array(3) is NOT significantly slower than using fbsql_fetch_row(3), while it provides
a significant added value.
PARAMETERS
o $
result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3).
o $result_type
- A constant and can take the following values: FBSQL_ASSOC, FBSQL_NUM, or FBSQL_BOTH. When using FBSQL_BOTH, in addition to
storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names
as keys.
RETURN VALUES
Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.
If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the
same name, you must the numeric index of the column or make an alias for the column.
select t1.f1 as foo t2.f1 as bar from t1, t2
EXAMPLES
Example #1
fbsql_fetch_array(3) example
<?php
fbsql_connect($host, $user, $password);
$result = fbsql_db_query("database", "select user_id, fullname from table");
while ($row = fbsql_fetch_array($result)) {
echo "user_id: " . $row["user_id"] . "<br />
";
echo "user_id: " . $row[0] . "<br />
";
echo "fullname: " . $row["fullname"] . "<br />
";
echo "fullname: " . $row[1] . "<br />
";
}
fbsql_free_result($result);
?>
SEE ALSO fbsql_fetch_row(3), fbsql_fetch_assoc(3), fbsql_fetch_object(3).
PHP Documentation Group FBSQL_FETCH_ARRAY(3)