I am trying to extract all the 2's from each row. 2 is just an example not a fixed number. The number of fields starting from the beginning of the each row are variable so I am trying to use the end of each row as the starting address to extract the 2 as the number of fields stay constant starting from the end of the row and moving backwards except some rows have an "f" or an "fm". When there is an "f" or an "fm" in the row, I want to extract the 3rd field from the end of the row (which will give me 2). When there is no "f" or "fm" in a row, I want to extract the 2nd field from the end of the row.
I also have blanks in the file and I want to extract those too. Does not matter which field I select for a blank line, any field will do as long as I get a blank.
Here is what I am trying:
It's giving me a syntax error on the else statement.
Also I know this won't work for a blank line as the NF will be zero.
i have a input file which does not have a delimiter
All i Need to do is to identify a line and extract the data from it and run the loop again and need to ensure that it was not extracted earlier
Input file
------------
abcd 12345 egfhijk ip 192.168.0.1 CNN.com
abcd 12345 egfhijk ip... (12 Replies)
Hello,
I have got one file with more than 120+ million records(35 GB in size). I have to extract some relevant data from file based on some parameter and generate other output file.
What will be the besat and fastest way to extract the ne file.
sample file format :--... (2 Replies)
Hello
i have go the following result from performing 2 testing using the same file.
I have used unix script to extract the result because the files are many as shown below.
01_gravity.f.tcov 7 3 42.86
02_gravity.f.tcov 9 4 80.86... (4 Replies)
Hi,
I have long string in 2nd field, as shown below:
REF1 | CLESCLJSCSHSCSMSCSNSCSRSCUDSCUFSCU7SCV1SCWPSCXGPDBACAPA0DHDPDMESED6
REF2 | SBR4PCBFPCDRSCSCG3SCHEBSCKNSCKPSCLLSCMCZXTNPCVFPCV6P4KL0DMDSDSASEWG
I have a group of fixed patterns which can occur in these long strings & only... (11 Replies)
Hi all,
I got a file that contains the following content, Actually it is a part of the file content,
Installing XYZ XYZA Image, API 18, revision 2
Unzipping XYZ XYZA Image, API 18, revision 2 (1%)
Unzipping XYZ XYZA Image, API 18, revision 2 (96%)
Unzipping XYZ XYZA Image, API 18,... (7 Replies)
Hello,
Using the information in file 1, I would like to extract from file2 all rows which matchs in column 3.
file 1
1233
1230
1231
1232
file2
65733.00 19775.00 1220
65733.00 19793.00 1220
65733.00 19801.00 1220
65733.00 19809.00 1231
65733.00 19817.00 ... (2 Replies)
Hi All,
I am having a file like below . Basically when SB comes in the text with B. I have to take the word till SB. When there only B I should take take till B. Tried for cut it by demilter but not able to build the logic
SB- CD B_RESTO SB_RESTO CRYSTALS BOILERS -->There SB and B so I... (6 Replies)
Discussion started by: arunkumar_mca
6 Replies
LEARN ABOUT PHP
mssql_fetch_row
MSSQL_FETCH_ROW(3)MSSQL_FETCH_ROW(3)mssql_fetch_row - Get row as enumerated arraySYNOPSIS
array mssql_fetch_row (resource $result)
DESCRIPTION mssql_fetch_row(3) fetches one row of data from the result associated with the specified result identifier. The row is returned as an
array. Each result column is stored in an array offset, starting at offset 0.
Subsequent call to mssql_fetch_row(3) would return the next row in the result set, or FALSE if there are no more rows.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
RETURN VALUES
Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.
EXAMPLES
Example #1
mssql_fetch_row(3) example
<?php
// Connect to MSSQL and select the database
$link = mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php', $link);
// Query to execute
$query = mssql_query('SELECT [id], [quote] FROM [quotes] WHERE [id] = '42'', $link);
// Did the query fail?
if (!$query) {
die('MSSQL error: ' . mssql_get_last_message());
}
// Fetch the row
$row = mssql_fetch_row($query);
// Print the 'quote'
echo 'Quote #' . $row[0] . ': "' . $row[1] . '"';
?>
The above example will output something similar to:
Quote #42: "The answer to everything..."
NOTES
Note
This function sets NULL fields to the PHP NULL value.
SEE ALSO mssql_fetch_array(3), mssql_fetch_object(3), mssql_data_seek(3), mssql_result(3).
PHP Documentation Group MSSQL_FETCH_ROW(3)