Sponsored Content
Top Forums UNIX for Dummies Questions & Answers analyzing list with street addresses Post 302495569 by M474746 on Thursday 10th of February 2011 03:20:44 PM
Old 02-10-2011
analyzing list with street addresses

Hi List,

Could someone please point me into the right direction with the following:

I have a file containing a list of street addresses.

I need to sort all the street addresses with the same number to a new file containing the street name and corresponding number.

So:
Code:
Strawinskylaan 1 > Strawinsky_1.txt
Strawinskylaan 2 > Strawinsky_2.txt
etc. etc.

I was thinking about something like this
Code:
a=0

for line in FiLENAME.txt
grep -A 1 "[$a]\{1,2\}\b" FILENAME.txt > "filename_$A.txt" 
a+=1

Any tip is much appreciated!

Thanks,

Martijn
(osX 10.6.5, bash)

Here's a short example of the file formatting:
Code:
Maatschap WTC Amsterdam E-Toren                                  *
Strawinskylaan 1, 1077XW Amsterdam                               

Maatschap WTC Amsterdam Zuidplein Hoog- en Laagbouw              *
Strawinskylaan 1, 1077XW Amsterdam                               

Maatschap WTC Amsterdam Zuidplein                                *
Strawinskylaan 2, 1077XW Amsterdam                               

Maatschap World Trade Center Amsterdam                           *
Strawinskylaan 3, 1077XW Amsterdam                               

H. Sligte Holding B.V.                                           *
Strawinskylaan 3, 1077XW Amsterdam


Last edited by Franklin52; 02-10-2011 at 04:44 PM.. Reason: Please use code tags, thank you
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help extracting MAC addresses from List

Hello all. I have a large number of text files outputted from various Netstumbler Wireless Scans; from which I need to extract the MAC addresses of the various Access Points. The Text files look like this: # $Creator: Network Stumbler Version 0.4.0 # $Format: wi-scan summary with... (9 Replies)
Discussion started by: dhs23
9 Replies

2. UNIX Desktop Questions & Answers

Using Mailx to send to list of email addresses

Im trying to use a shell script to send to a list of email addresses in a txt file. Here is what i have tried but it keeps sending to dead.letter... Success.ksh contains... mailx -s"Night Batch Success" 'cat /Scripts/email_addresses.txt' < /Scripts/email_body_message.txt The email body... (1 Reply)
Discussion started by: aguad3
1 Replies

3. Solaris

Command to list all the VIP addresses assigned to Solaris server

Hello All, I want to list all the VIP addresses assigned to Solaris server. whats the command we have use on solaris for this? Please help Thanks!! Weblogic Consultant (1 Reply)
Discussion started by: weblogicsupport
1 Replies

4. Shell Programming and Scripting

Extract list of IP addresses from a text file.

I have an xml file with IP addresses all over the show. I want to print only the IP addresses and cut off any text before or after the IP address. Example: Note: The IP addresses (x.x.x.x) do not consistently appear in the xml file as per the pattern below. Sometimes there are text before... (8 Replies)
Discussion started by: lewk
8 Replies

5. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

6. Shell Programming and Scripting

Formatting list of IP addresses into a grep command

Hi I have an input file with a list of random IP addresses, each on a new line. Below is just an example as I omitted the real IP addresses for obvious reasons. Input: random_ip.txt 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1... (7 Replies)
Discussion started by: lewk
7 Replies

7. UNIX for Dummies Questions & Answers

List Contacted Web Addresses?

Greetings. I'm in the process of tracking down an issue with Firefox, and need some way of gathering the actual web addresses which are connected to from localhost. The specific problem centers around the determination/capture of the exact generated app.update.url address formed by the... (2 Replies)
Discussion started by: LinQ
2 Replies
XML::PatAct::Amsterdam(3pm)				User Contributed Perl Documentation			       XML::PatAct::Amsterdam(3pm)

NAME
XML::PatAct::Amsterdam - An action module for simplistic style-sheets SYNOPSIS
use XML::PatAct::Amsterdam; my $patterns = [ PATTERN => { Before => 'before', After => 'after' }, ... ]; my $matcher = XML::PatAct::Amsterdam->new( I<OPTIONS> ); DESCRIPTION
XML::PatAct::Amsterdam is a PerlSAX handler for applying pattern-action lists to XML parses or trees. XML::PatAct::Amsterdam applies a very simple style sheet to an instance and outputs the result. Amsterdam gets it's name from the Amsterdam SGML Parser (ASP) which inspired this module. CAUTION: Amsterdam is a very simple style module, you will run into it's limitations quickly with even moderately complex XML instances, be aware of and prepared to switch to more complete style modules. New XML::PatAct::Amsterdam instances are creating by calling `new()'. Parameters can be passed as a list of key, value pairs or a hash. A Patterns and Matcher options are required. The following OPTIONS are supported: Patterns The pattern-action list to apply. The list is an anonymous array of pattern, action pairs. Each action in the list contains either or both a Before and an After string to copy to the output before and after processing an XML element. The Before and After strings may contain attribute names enclosed in square brackets (`"["' NAME `"]"'), these are replaced with the value of the attribute with that name. The special NAME `"_element"' will be replaced with the element's name. Matcher An instance of the pattern or query matching module. Output An IO::Handle or one of it's subclasses (such as IO::File), if this parameter is not present and the AsString option is not used, the module will write to standard output. AsString Return the generated output as a string from the `"parse()"' method of the PerlSAX event generator. AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us SEE ALSO
perl(1) ``Using PatAct Modules'' and ``Creating PatAct Modules'' in libxml-perl. perl v5.10.1 2003-10-21 XML::PatAct::Amsterdam(3pm)
All times are GMT -4. The time now is 10:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy