02-29-2012
Try using printf instead of print...
This User Gave Thanks to Vidhyaprakash For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
In open office spreadsheet, i would like to fill a cell with the name of the spread sheet.
That is if the file name of spread sheet is, team.ods, then i have to fill a specific cell with that name 'team'. How to do that ?
I have more spread sheets to be created, so i want it to be done... (0 Replies)
Discussion started by: thegeek
0 Replies
2. Shell Programming and Scripting
Greetings,
I have a hard time creating a large number of user profiles in a database.
The data file looks like this :
01/01/80 Mitch Conley
.
.
.
.
And I need to put the output into:
Name: Mitch
Surname: Conley
Birthday: 01/01/80
Thanks in advance! (3 Replies)
Discussion started by: hemo21
3 Replies
3. Shell Programming and Scripting
Hi All,
I have 100 files with names like this:
1.dat, 2.dat, 3.dat until 100.dat.
My dat files look like this:
42323 0
438939 1
434 0
0.9383
3434
120.23 3
234
As you can see in the second column, some numbers are missing. I want to fill those missing places with 0's in all... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
4. Shell Programming and Scripting
hello everyone,
I have a task to input missing data into a file. example of my data below:
Wed Feb 01 09:00:02 EST 2012,,,0.4,0.3,,0.3,,0.3,,0.5,,0.3,,,0.4,0.3,
Wed Feb 01 09:00:11 EST 2012,,,,,,,0.2,,,,,,,,,,
Wed Feb 01 09:00:22 EST... (23 Replies)
Discussion started by: Nolph
23 Replies
5. Shell Programming and Scripting
Hello,
I need help for writing a script that fills already generated xml file with data from oracle database and random sequences.
For example if we have the following tags:
<ns1:message>
<ns1:messageId> </ns1:messageId>
<ns1:languageCode> </ns1:languageCode>... (10 Replies)
Discussion started by: zb99
10 Replies
6. Shell Programming and Scripting
Hello experts,
Please help me in achieving this in an easier way possible. I have 2 csv files with following data:
File1
08/23/2012 12:35:47,JOB_5330
08/23/2012 12:35:47,JOB_5330
08/23/2012 12:36:09,JOB_5340
08/23/2012 12:36:14,JOB_5340
08/23/2012 12:36:22,JOB_5350
08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies
7. Shell Programming and Scripting
Hi
I want to get all numbers if number range is given as input.
Eg:
INPUT FILE
100-105
107
108-112
OUTPUT REQUIRED:
100 101 102 103 104 105
107
108 109 110 111 112
How can I do it using shell? :confused:
Thanks in advance. (11 Replies)
Discussion started by: dashing201
11 Replies
8. Shell Programming and Scripting
Gents,
Kindly help me.
I have a file with empty values in selected column, I will like to fill the empty values with the previous value.
Example
Input file
X 4959 30010 66727.00 20457.001 1 1441 66512.00 20234.00 20520.001
X 4959 30010 66727.00 20457.001 145 ... (7 Replies)
Discussion started by: jiam912
7 Replies
9. UNIX for Dummies Questions & Answers
I have a csv that looks like this:
,yude-to-nap2,0,0,0,0,0
,2twis-yude-to-nap2,0,0,0,0,0
,2tiws-yude-to-nap2,0,0,0,0,0
,2arcos-yude-to-nap2,0,0,0,0,0
and another file named m1 that has a single line of text as content:
Feb 1 15:30:20
How can I fill the whole the empty column of the... (1 Reply)
Discussion started by: RobertoRivera
1 Replies
10. Shell Programming and Scripting
Hi,
I have the following content in file
ABBR DESC COL3 COL4 COL5 COL6
AAA text desc aaa text text text text
text text text text
text text text text
BBB text desc bbb text text text text
text text text text
CCC ... (10 Replies)
Discussion started by: bobbygsk
10 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)