u want to print first row with fourth column and second row with fifth column; the code is below
The error is shown with syntax error; what can be done
And another question is that if there is to print first row with fourth column and last row with fifth column; in each file; how the solution with awk will be?
First, please use CODE tags (not QUOTE tags) to show contents of files.
Second, we seem to have a language barrier. I do not understand what you want. Are you asking for a script that uses awk to read two lines from a file and write just column 4 from the 1st row and column 5 from the 2nd row? If this is what you want, you can get it using something like:
Are you asking for a script that reads a file and prints the 1st line that contains 4 or more columns and the 2nd line that contains 5 or more columns?
Please show us the output you want from the sample input you provide (in CODE tags) so we more clearly understand what you're trying to do.
This User Gave Thanks to Don Cragun For This Post:
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)
Hello,
I have an input file like the following:
11_3_4
2_1_35
3_15__
_16989
Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Hi, Please read the whole thread.
I have been working on this script below. It works fine, feel free to copy and test with the INPUT File below as well.
example:
PACKET DATA PROTOCOL CONTEXT DATA
APNID PDPADD EQOSID VPAA PDPCH PDPTY PDPID
10 ... (6 Replies)
Hi Friends,
I have a single column data like below.
1
2
3
4
5
I need the output like below.
0
1
2
3
4
where each row (including first row) subtracting from first row and the result should print below like the way shown in output file.
Thanks
Sid (11 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 table with this structure:
cola colb colc
1 19 lemon
20 31 lemon
32 100 lemon
159 205 cherries
210 500 cherries
and need to parse it into this format:
cola colb colc
1 100 lemon
159 500 cherries
So I need the first row of cola and the last row of colb if colc has the... (3 Replies)
Hi,
I have a comma separated file. I would like to print every alternate columns into a new row.
Example input file:
Name : John, Age : 30, DOB : 30-Oct-2018
Example output:
Name,Age,DOB
John,30,30-Oct-2018 (3 Replies)
Discussion started by: Lini
3 Replies
LEARN ABOUT PHP
ibase_fetch_assoc
IBASE_FETCH_ASSOC(3) 1 IBASE_FETCH_ASSOC(3)ibase_fetch_assoc - Fetch a result row from a query as an associative arraySYNOPSIS
array ibase_fetch_assoc (resource $result, [int $fetch_flag])
DESCRIPTION
Fetch a result row from a query as an associative array.
ibase_fetch_assoc(3) fetches one row of data from the $result. If two or more columns of the result have the same field names, the last
column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by
using ibase_fetch_row(3) or use alias names in your query.
PARAMETERS
o $result
- The result handle.
o $fetch_flag
-$fetch_flag is a combination of the constants IBASE_TEXT and IBASE_UNIXTIME ORed together. Passing IBASE_TEXT will cause this
function to return BLOB contents instead of BLOB ids. Passing IBASE_UNIXTIME will cause this function to return date/time values
as Unix timestamps instead of as formatted strings.
RETURN VALUES
Returns an associative array that corresponds to the fetched row. Subsequent calls will return the next row in the result set, or FALSE if
there are no more rows.
SEE ALSO ibase_fetch_row(3), ibase_fetch_object(3).
PHP Documentation Group IBASE_FETCH_ASSOC(3)