06-04-2019
Suppose that column 3 matches both a previous row and another row further down. What happens?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I want to replace a column in a file if it matches certain pattern. Can you help me on this.
Here is the file content.
000000 1111111 2222222
011111 0123445 1234556
023445 1111111 2343455
if second column contains 1111111 i need to replace it with 0000000
Can you... (6 Replies)
Discussion started by: Krrishv
6 Replies
2. Shell Programming and Scripting
Hi there,
I've an input file1 as follows:
1001
1002
1003
1004
1005
I would like to have an output file2 as follows:
Numbers are 1001/ 1002/ 1003/ 1004/ 1005/
Any help is appreciated. (2 Replies)
Discussion started by: kbirde
2 Replies
3. Shell Programming and Scripting
Given a file such as this I need to remove the duplicates.
00060011 PAUL BOWSTEIN ad_waq3_921_20100826_010517.txt
00060011 PAUL BOWSTEIN ad_waq3_921_20100827_010528.txt
0624-01 RUT CORPORATION ad_sade3_10_20100827_010528.txt
0624-01 RUT CORPORATION ... (13 Replies)
Discussion started by: script_op2a
13 Replies
4. Shell Programming and Scripting
Can anyone please help with this? I have 2 files as given below.
If 2nd column of file1 has pattern foo1@a, find the matching 1st column in file2 & replace 2nd column of file1 with file2's value.
file1
abc_1 foo1@a ....
abc_1 soo2@a ...
def_2 soo2@a ....
def_2 foo1@a ........ (7 Replies)
Discussion started by: prashali
7 Replies
5. Shell Programming and Scripting
Hi All,
I have been trying to transpose rows to column in an large file (about 15000 lines) between matching pattern. Searched all posts in this forum, but not able find the solution to my problem. Any help appreciated.!!
Input
/*------XXXXXX-------*/
owner: XXXX
location: XXXX... (3 Replies)
Discussion started by: RobP
3 Replies
6. UNIX for Dummies Questions & Answers
file with this content
awk 'NR==1 {print $4} && NR==2 {print $5}' file
The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies
7. Shell Programming and Scripting
Hi,
I have the following file,
chr1 100 200 20
chr1 201 300 22
chr1 220 345 23
chr1 230 456 33.5
chr1 243 567 90
chr1 345 600 20
chr1 430 619 21.78
chr1 870 910 112.3
chr1 914 920 12
chr1 930 999 13
My output would be
peak1 20 22 23 33.5 90
peak2 20 21.78 112.3 12 13
Here the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
8. Shell Programming and Scripting
This is my input file :
# cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9
This is the required output
... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies
9. Shell Programming and Scripting
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
10. Shell Programming and Scripting
I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID
Scenario is: delete all line if Employee Number (1st column) contains below
1. Non-numeric Employee Number
2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies
LEARN ABOUT PHP
pdostatement.fetchcolumn
PDOSTATEMENT.FETCHCOLUMN(3) 1 PDOSTATEMENT.FETCHCOLUMN(3)
PDOStatement::fetchColumn - Returns a single column from the next row of a result set
SYNOPSIS
public mixed PDOStatement::fetchColumn ([int $column_number])
DESCRIPTION
Returns a single column from the next row of a result set or FALSE if there are no more rows.
Note
PDOStatement.fetchColumn(3) should not be used to retrieve boolean columns, as it is impossible to distinguish a value of FALSE from
there being no more rows to retrieve. Use PDOStatement.fetch(3) instead.
PARAMETERS
o $column_number
- 0-indexed number of the column you wish to retrieve from the row. If no value is supplied, PDOStatement.fetchColumn(3) fetches
the first column.
RETURN VALUES
PDOStatement.fetchColumn(3) returns a single column in the next row of a result set.
Warning
There is no way to return another column from the same row if you use PDOStatement.fetchColumn(3) to retrieve data.
EXAMPLES
Example #1
Return first column of the next row
<?php
$sth = $dbh->prepare("SELECT name, colour FROM fruit");
$sth->execute();
print("Fetch the first column from the first row in the result set:
");
$result = $sth->fetchColumn();
print("name = $result
");
print("Fetch the second column from the second row in the result set:
");
$result = $sth->fetchColumn(1);
print("colour = $result
");
?>
The above example will output:
Fetch the first column from the first row in the result set:
name = lemon
Fetch the second column from the second row in the result set:
colour = red
SEE ALSO
PDO.query(3), PDOStatement.fetch(3), PDOStatement.fetchAll(3), PDO.prepare(3), PDOStatement.setFetchMode(3).
PHP Documentation Group PDOSTATEMENT.FETCHCOLUMN(3)