I tried that exact code. The issue is that something is wrong with the use of "${file_delimiter}". when I echo the statement and exit the script, the value comes as an empty string. I'm not sure why. But when I cat the file it comes. The echo statement with the above code shows:
I am using grep and I want the output to go into two files without going to the screen. I used tee to get the output into two files, but it is also putting the output on the screen which i do not want. Can this be fixed. (2 Replies)
Helllo UNIX Forum :)
Since I am posting on this board, yes, I am new to UNIX!
I read a copy of "UNIX made easy" from 1990, which felt like a making a "computer-science time jump" backwards ;)
So, basically I have some sort of understanding what the basic concept is.
Problem Description:... (6 Replies)
This script is supposed to find out if tomcat is running or not.
#!/bin/sh
if netstat -a | grep `grep ${1}: /tomcat/bases | awk -F: '{print $3}'` > /dev/null
then
echo Tomcat for $1 running
else
echo Tomcat for $1 NOT running
fi
the /tomcat/bases is a file that... (2 Replies)
Hi,
I'd like to process multiple files. For example:
file1.txt
file2.txt
file3.txt
Each file contains several lines of data. I want to extract a piece of data and output it to a new file.
file1.txt ----> newfile1.txt
file2.txt ----> newfile2.txt
file3.txt ----> newfile3.txt
Here is... (3 Replies)
Howdy Folks,
I have a list that looks like this:
(file2.txt)
AAA
BBB
CCC
DDD
and there are 24 of these short words.
I am matching these patterns to another file with 755795 lines (file1.txt).
I have this code for matching:
awk -v f2=file2.txt '
BEGIN {
while(... (2 Replies)
Hi!
I'm new in awk and I need some help.
I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files.
Thanks in advance for help!
:-)
ciao (5 Replies)
I have a script that finds all sffs and extracts them into .fastq file types. What I need to do is change the .fastq to .fasta using the below script. How can I change the input.fastq and output.fasta to mirror the file's name? Would I use an array and use the default iterator?
#!/bin/bash
... (3 Replies)
Hi Friends,
I am using a command that prints certain lines from a file.
For ex:
cat input
abc chr1 456
def chr1 789
ghi chr1 999
jjj chr1 777
jhk chr7 914
My command
awk '{if($2=="chr1" && $3>=456 && $3<=999) {print $0}}' OFS="\t" input
Output being printed is
abc chr1 456 (7 Replies)
Hi,
I have a following code in which I am unable to redirect to multiple files. Can anybody please help with some corrections
awk -F, '{ if ( substr($1,26,2)=="02" && substr($1,184,14)=="MTSCC_VALFIRST") {
array1++
array2++
array3++
}
else if (substr($1,26,2)=="03" &&... (4 Replies)
What is the correct syntax to pipe or run three awk commands? Basically, using the output of the first awk as input in the second. Then using the output of the second awk in the third. Thank you :).
awk 'FNR==NR {E; next }$3 in E {print $3, $5}' panel_genes.txt RefSeqGene.txt > update.txt |... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT PHP
oci_field_name
OCI_FIELD_NAME(3)OCI_FIELD_NAME(3)oci_field_name - Returns the name of a field from the statementSYNOPSIS
string oci_field_name (resource $statement, mixed $field)
DESCRIPTION
Returns the name of the $field.
PARAMETERS
o $statement
- A valid OCI statement identifier.
o $field
- Can be the field's index (1-based) or name.
RETURN VALUES
Returns the name as a string, or FALSE on errors.
EXAMPLES
Example #1
oci_field_name(3) example
<?php
// Create the table with:
// CREATE TABLE mytab (number_col NUMBER, varchar2_col varchar2(1),
// clob_col CLOB, date_col DATE);
$conn = oci_connect("hr", "hrpwd", "localhost/XE");
if (!$conn) {
$m = oci_error();
trigger_error(htmlentities($m['message']), E_USER_ERROR);
}
$stid = oci_parse($conn, "SELECT * FROM mytab");
oci_execute($stid, OCI_DESCRIBE_ONLY); // Use OCI_DESCRIBE_ONLY if not fetching rows
echo "<table border="1">
";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Type</th>";
echo "<th>Length</th>";
echo "</tr>
";
$ncols = oci_num_fields($stid);
for ($i = 1; $i <= $ncols; $i++) {
$column_name = oci_field_name($stid, $i);
$column_type = oci_field_type($stid, $i);
echo "<tr>";
echo "<td>$column_name</td>";
echo "<td>$column_type</td>";
echo "</tr>
";
}
echo "</table>
";
// Outputs:
// Name Type
// NUMBER_COL NUMBER
// VARCHAR2_COL VARCHAR2
// CLOB_COL CLOB
// DATE_COL DATE
oci_free_statement($stid);
oci_close($conn);
?>
NOTES
Note
In PHP versions before 5.0.0 you must use ocicolumnname(3) instead. This name still can be used, it was left as alias of
oci_field_name(3) for downwards compatability. This, however, is deprecated and not recommended.
SEE ALSO oci_num_fields(3), oci_field_type(3), oci_field_size(3).
PHP Documentation Group OCI_FIELD_NAME(3)