Sponsored Content
Top Forums Shell Programming and Scripting Replace Entire line if any part matches regexp Post 302236072 by Cocoabean on Sunday 14th of September 2008 03:02:48 PM
Old 09-14-2008
You could be right, I was not able to hit enter in a cell to create a newline character. I am not yet sure if excel will take the address broken up by City State Zip etc. Thanks for your help though Franklin. I'll follow up on this when I find a solution... err maybe another feasible problem.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Search and replace entire line

I have a perl function in my script that needs to replace an entire line in a file sub changestate { my $base = (); my @base = (); open(BASE, $file) || die("Could not open file!"); @base=<BASE>; close (BASE); foreach $base(@base) { if($base =~... (1 Reply)
Discussion started by: insania
1 Replies

2. Shell Programming and Scripting

sort entire line based on part of the string

hey gurus, my-build1-abc my-build10-abc my-build2-abc my-build22-abc my-build3-abc basically i want to numerically sort the entire lines based on the build number. I dont zero pad the numbers because thats "how it is" ;-) sort -n won't work because it starts from the beginning. ... (10 Replies)
Discussion started by: gurpal2000
10 Replies

3. Shell Programming and Scripting

Does Sed Search/Replace Work For Multiple Matches On The Same Line?

Hello, I would like to delete all the footnotes in all my htm files. Hence, I have to delete the whole font tag pairs, i.e. deleting everything between the begin/end font tags. I create a testfile, of which data parts of all four lines are the same except for the number of font tag pairs,... (3 Replies)
Discussion started by: cibalo
3 Replies

4. UNIX for Advanced & Expert Users

command to replace the entire line from the key point

Hi everyone I am new to Unix. I got stuck up by small issue. I have text file something like this abc 'xyz' '5' lmn 'pqr' '7' i want to replace the abc 'xyz' '5' to abc 'xyz' '6' but i have a key as 'xyz' based on this key i want to do that. I am not aware of how to use sed... (7 Replies)
Discussion started by: Vijayaragavan
7 Replies

5. Shell Programming and Scripting

Replace entire line

I want to replace one line from my configuration file with the new settings. The file Name: /etc/httpd/conf/httpd.conf The following line should be replaced with the line mentioned below. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "\"%h\"... (3 Replies)
Discussion started by: shantanuo
3 Replies

6. Shell Programming and Scripting

Need to find a string, check the next line, and if it matches certain criteria, replace it with a s

Hey Fellas. I am new to scripting. I have searched through the forums and found a lot of good info, but I can't seem to get any of it to work together. I am trying to find a particular sting in a file, and if the next string matches certain criteria, replace it with a string from a csv... (6 Replies)
Discussion started by: midniteslice
6 Replies

7. Shell Programming and Scripting

Help with sed to replace entire line

Hi, I need to replace an entire mailx line as follows using sed: sed -e 's/<line1>/<newline>/g' <filename> But I am getting comman garbled error since the new line has many special characters. I enclosed allspecial chars in \ but still no use. Can any one help me? Please use code... (2 Replies)
Discussion started by: vinodhin4
2 Replies

8. Shell Programming and Scripting

Print entire line only if certain fixed character matches the string

Hi All, I have a file testarun.txt contains the below lines and i want to print the lines if the character positions 7-8 matches 01. 201401011111 201401022222 201402013333 201402024444 201403015555 201403026666 201404017777 201404028888 201405019999 201405020000 I am trying the... (4 Replies)
Discussion started by: Arunprasad
4 Replies

9. Shell Programming and Scripting

Remove entire line from a file if 1st column matches a pattern

I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID Scenario is: delete all line if Employee Number (1st column) contains below 1. Non-numeric Employee Number 2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies

10. UNIX for Beginners Questions & Answers

Replace matches string in each line with the arrayvalue in shell

I have a list of value , and need to replace that in my file. Eg: File1 tcname:fail tcname: Pass tcname:skipped File2: 01,02,03 Output: File 1 01:fail 02: Pass 03:Skipped (8 Replies)
Discussion started by: DevAakash
8 Replies
GEOIP_RECORD_BY_NAME(3) 						 1						   GEOIP_RECORD_BY_NAME(3)

geoip_record_by_name - Returns the detailed City information found in the GeoIP Database

SYNOPSIS
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)
All times are GMT -4. The time now is 05:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy