Thank you very much for the reply, it has helped me a lot!!!
However I need an extra upgrade I guess shouldn´t be too complicated to implement:
The awk command gave me the result I needed, however I will need to change thresholds depending on the domain (eg: EH, ERP, etc), and above that add 2 extra columns with the min and max thresholds that are set for that row.
NOW:
Any help is very much appreciatted!! Thank you in advance for your time!
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)
Dear all,
Does anyone know how I could to add a column of numbers (1s, or 2s, or..., or 6s) to two-column text files (tab-delimited), where the specific number to be added varies as a function of the file naming?
Currently, each of my text files has two columns, so the column with the... (12 Replies)
Good afternoon to everyone,
I have some input and output from various widgets that I am trying to get to play nicely together. Basically I would like to stay out of excel and be able to automate the entire process. I have read some posts here about how to use awk, nawk, etc, to do similar... (9 Replies)
Hi All ,
Kindly help me with this soln
awk '{printf "%s %7s \n", $1,$c}' infile
where
value of variable c I am externally giving input
But executing the above command shows all the columns of infile where as I want only 1st column of infile and 2nd column should print value c (8 Replies)
I have a space delimited text file with two columns. I would like to add NA to the first column of the text file.
Input:
19625 10.4791768259
19700 10.8146489183
19701 10.9084026759
19702 10.9861346978
19703 10.9304364984
Output:
NA19625 10.4791768259
NA19700 10.8146489183... (1 Reply)
Hi,
I have a tab delimited text file with three different columns. I want to add an extra column to the text file. The extra column will be the second column and it will equal third column - 1. How do I go about doing that? Thanks!
Input:
chr1 788822 rs11240777
chr1 1008567 rs9442372... (2 Replies)
Hi,
I would like to add a new column containing the row numbers to a text file. How do I go about doing that? Thanks!
Example input:
A X
B Y
C D
Output:
A X 1
B Y 2
C D 3 (5 Replies)
Hi,
I am not so familiar with bash scripting and would appreciate your help here.
I have a text file 'input.txt' like this:
2 3 4
5 6 7
8 9 10
I want to store each column in an array like this
a ={2 5 8}, b={3 6 9}, c={4 7 10}
so that i can access any element, e.g b=6 for the later use. (1 Reply)
Hi Folks,
I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file.
bash scripting is what i need.
Data.txt
Name OrderID Quantity
Sam 123 300
Jay 342 498
Kev 78 2500
Sam 420 50
Vic 10... (3 Replies)
Hello,
Can someone please help in below requirement.
My requirement is to add date before to first column,some text before 1st,2nd coulmns and insert a new column in between 2 and 3 columns.
input file.
aa 123 dddd
aa 667 kdkdk
ddj 738 kkkk
aa 123 dddd
aa 667 ... (5 Replies)
Discussion started by: Cva2568
5 Replies
LEARN ABOUT PHP
cubrid_fetch_array
CUBRID_FETCH_ARRAY(3) 1 CUBRID_FETCH_ARRAY(3)cubrid_fetch_array - Fetch a result row as an associative array, a numeric array, or bothSYNOPSIS
array cubrid_fetch_array (resource $result, [int $type = CUBRID_BOTH])
DESCRIPTION
The cubrid_fetch_array(3) function is used to get a single row from the query result and returns an array. The cursor automatically moves
to the next row after getting the result.
PARAMETERS
o $result
-$Result comes from a call to cubrid_execute(3)
o $type
-Array type of the fetched result CUBRID_NUM, CUBRID_ASSOC, CUBRID_BOTH. If you need to operate the lob object, you can use
CUBRID_LOB.
RETURN VALUES
Returns an array of strings that corresponds to the fetched row, when process is successful.
FALSE, when there are no more rows; NULL, when process is unsuccessful.
The type of returned array depends on how type is defined. By using CUBRID_BOTH (default), you'll get an array with both associative and
number indices, and you can decide which data type to use by setting the $type argument. The $type variable can be set to one of the fol-
lowing values:
oCUBRID_NUM : Numerical array (0-based)
oCUBRID_ASSOC : Associative array
oCUBRID_BOTH : Numerical & Associative array (default)
EXAMPLES
Example #1
cubrid_fetch_array(3) example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$req = cubrid_execute($conn, "SELECT name,area,seats,address FROM stadium WHERE nation_code='GRE' AND seats > 10000");
printf("%-40s %-10s %-6s %-20s
", "name", "area", "seats", "address");
while ($row = cubrid_fetch_array($req, CUBRID_NUM)) {
printf("%-40s %-10s %-6s %-20s
", $row[0], $row[1], $row[2], $row[3]);
}
// if you want to operate LOB object, you can use cubrid_fetch_array($req, CUBRID_NUM | CUBRID_LOB)
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
The above example will output:
name area seats address
Panathinaiko Stadium 86300.00 50000 Athens, Greece
Olympic Stadium 54700.00 13000 Athens, Greece
Olympic Indoor Hall 34100.00 18800 Athens, Greece
Olympic Hall 52400.00 21000 Athens, Greece
Olympic Aquatic Centre 42500.00 11500 Athens, Greece
Markopoulo Olympic Equestrian Centre 64000.00 15000 Markopoulo, Athens, Greece
Faliro Coastal Zone Olympic Complex 34650.00 12171 Faliro, Athens, Greece
Athens Olympic Stadium 120400.00 71030 Maroussi, Athens, Greece
Ano Liossia 34000.00 12000 Ano Liosia, Athens, Greece
SEE ALSO cubrid_execute(3), cubrid_fetch(3), cubrid_fetch_row(3), cubrid_fetch_assoc(3), cubrid_fetch_object(3).
PHP Documentation Group CUBRID_FETCH_ARRAY(3)