hi
im completely new at unix so dont hate me for asking what is probably the easiest question ever.
below is an extract of some data im processing. the first column is like a counter while the second is an ip address. i need to be able to output the ip address based on which has the largest... (4 Replies)
this works:
cat file.txt| awk 'NR==45,NR==55'
but how do I assign variables instead of numbers:
this does not work:
cat file.txt | awk 'NR==$start,NR==$end'
there need variables instead of numbers
Sorry for my English
Thank you for answer (3 Replies)
Hi all
I have file with columns
F3 pathway CPS
F2
H2
H4
H5
H6 no pathway CMP
H7
H8
H9
H10
My expected output is
F3 pathway CPS
F2 pathway CPS (10 Replies)
I have a spreadsheet of extremely long rows of numbers. I want to print only the last column. Tried using printf but there seems to be too many rows.
example:
3 100 34 7 23 0 8 ..... X
400 203 778 1 ..........Y
58 3 9 0 100 ..........Z
I only want to print X, Y and... (1 Reply)
I have this in a file
11.22.33.44
yyyyyyuser
With awk/sed, I need this to be output as follows
alias server.domain.com='ssh yyyyyyuser@11.22.33.44' (4 Replies)
Hi.
How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg
file1
1:abc
3:ghi
6:pqr
file2
a abc
b def
c ghi
d jkl
e mno
f pqr
... (6 Replies)
Hi. How can I read row number from one file and print that corresponding record present at that row in another file.
eg
file1
1
3
5
7
9
file2
11111
22222
33333
44444
55555
66666
77777
88888
99999 (3 Replies)
this is the requirement
list.txt
table1
table2
table3
testfile.txt
name#place#data#select * from table1
name2#place2#data2#select * from table 10 innerjoin table3
name2#place2#data2#select * from table 10
output
name place table1
name2 place table3
i tried using awk (7 Replies)
CUBRID_LOB2_READ(3) 1 CUBRID_LOB2_READ(3)cubrid_lob2_read - Read from BLOB/CLOB data.
SYNOPSIS
string cubrid_lob2_read (resource $lob_identifier, int $len)
DESCRIPTION
The cubrid_lob2_read(3) function reads $len bytes from the LOB data and returns the bytes read.
PARAMETERS
o $lob_identifier
-Lob identifier as a result of cubrid_lob2_new(3) or get from the result set.
o $len
-Length from buffer you want to read from the lob data.
RETURN VALUES
Returns the contents as a string.
FALSE when there is no more data.
NULL on failure.
EXAMPLES
Example #1
cubrid_lob2_read(3) example 1
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "public", "");
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
print "position now is " . cubrid_lob2_tell($row[1]) . "
";
cubrid_lob2_seek($row[1], 10, CUBRID_CURSOR_FIRST);
print "
position after moving farword is " . cubrid_lob2_tell($row[1]) . "
";
$data = cubrid_lob2_read($row[1], 12);
print "
position after reading is " . cubrid_lob2_tell($row[1]) . "
";
print $data . "
";
cubrid_lob2_seek($row[1], 5, CUBRID_CURSOR_CURRENT);
print "
position after moving again is " . cubrid_lob2_tell($row[1]) . "
";
$data = cubrid_lob2_read($row[1], 20);
print $data . "
";
cubrid_disconnect($conn);
?>
Example #2
cubrid_lob2_read(3) example 2
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
$req = cubrid_execute($conn, "select * from test_lob");
$row = cubrid_fetch_row($req, CUBRID_LOB);
while (true) {
if ($data = cubrid_lob2_read($row[1], 1024)) {
print $data . "
";
}
elseif ($data === false) {
print "There is no more data
";
break;
}
else {
print "There must some errors
";
break;
}
}
cubrid_disconnect($conn);
?>
SEE ALSO cubrid_lob2_write(3), cubrid_lob2_seek(3), cubrid_lob2_seek64(3), cubrid_lob2_tell(3), cubrid_lob2_tell64(3), cubrid_lob2_size(3),
cubrid_lob2_size64(3).
PHP Documentation Group CUBRID_LOB2_READ(3)