Hi All,
I need to print the lines after 2nd line irrespective of the number of lines in file
if the file contents are like below
----------
root:!:0:0::/root:/usr/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp:... (6 Replies)
Hi,
Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11
Thanks for your help. (6 Replies)
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
hello,
I go text file like this
E:/DDD/Dyndede/wwww
E:/DDD/sss.com/ffffg/fff
E:/DDD/vvvvvv/dd
E:/DDD/sss.com/bbbbbb
E:/DDD/sss.com/nnnn/xxI want to print
/alpha.jpg at the end of every lines like that
E:/DDD/Dyndede/wwww/alpha.jpg
E:/DDD/sss.com/ffffg/fff/alpha.jpg... (8 Replies)
Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT
+SRR057408.1 FW8Y5CK02R652T length=34
FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like:
<ROW>
some information
more information
</ROW>
I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
I have a text file with a list of items/patterns:
ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig12238
ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig34624... (1 Reply)
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
In the awk below I am trying to print the entire line, along with the header row, if $2 is SNV or MNV or INDEL. If that condition is met or is true, and $3 is less than or equal to 0.05, then in $7 the sub pattern :GMAF= is found and the value after the = sign is checked. If that value is less than... (0 Replies)
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
LEARN ABOUT PHP
geoip_record_by_name
GEOIP_RECORD_BY_NAME(3) 1 GEOIP_RECORD_BY_NAME(3)geoip_record_by_name - Returns the detailed City information found in the GeoIP DatabaseSYNOPSIS
array geoip_record_by_name (string $hostname)
DESCRIPTION
The geoip_record_by_name(3) function will return the record information corresponding to a hostname or an IP address.
This function is available for both GeoLite City Edition and commercial GeoIP City Edition. A warning will be issued if the proper data-
base cannot be located.
The names of the different keys of the returning associative array are as follows:
o "continent_code" -- Two letter continent code (as of version 1.0.4 with libgeoip 1.4.3 or newer)
o "country_code" -- Two letter country code (see geoip_country_code_by_name(3))
o "country_code3" -- Three letter country code (see geoip_country_code3_by_name(3))
o "country_name" -- The country name (see geoip_country_name_by_name(3))
o "region" -- The region code (ex: CA for California)
o "city" -- The city.
o "postal_code" -- The Postal Code, FSA or Zip Code.
o "latitude" -- The Latitude as signed double.
o "longitude" -- The Longitude as signed double.
o "dma_code" -- Designated Market Area code (USA and Canada only)
o "area_code" -- The PSTN area code (ex: 212)
PARAMETERS
o $hostname
- The hostname or IP address whose record is to be looked-up.
RETURN VALUES
Returns the associative array on success, or FALSE if the address cannot be found in the database.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 1.0.4 | |
| | |
| | Adding the continent_code with GeoIP Library |
| | 1.4.3 or newer only |
| | |
| 1.0.3 | |
| | |
| | Adding country_code3 and country_name |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
A geoip_record_by_name(3) example
This will print the array containing the record of host example.com.
<?php
$record = geoip_record_by_name('www.example.com');
if ($record) {
print_r($record);
}
?>
The above example will output:
Array
(
[continent_code] => NA
[country_code] => US
[country_code3] => USA
[country_name] => United States
[region] => CA
[city] => Marina Del Rey
[postal_code] =>
[latitude] => 33.9776992798
[longitude] => -118.435096741
[dma_code] => 803
[area_code] => 310
)
PHP Documentation Group GEOIP_RECORD_BY_NAME(3)