Sponsored Content
Top Forums Shell Programming and Scripting sed: print out to first blank line Post 302268433 by lagagnon on Monday 15th of December 2008 05:59:09 PM
Old 12-15-2008
sed: print out to first blank line

I am trying to use wget and sed to extract a text based weather forecast for the Greater Victoria area only, this is one paragraph of many in a web page. I have tried /^$/ but that does not seem to work. So far I get mostly what I want with this:

wget -qO - http://www.weatheroffice.gc.ca/forecast/textforecast_e
.html?Bulletin=fpcn11.cwvr | sed -n "/Greater Victoria/,/Fraser/p
"

but that stops one line ahead of what I want by using /Fraser/ . How can I change the sed portion of above to stop at what appears to be a blank line in the text?

Larry
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed: delete regex line and next line if blank

Hi, I want to write a sed script which from batiato: batiato/giubbe: pip_b.2.txt pip_b.3.txt pip_b.3mmm.txt bennato: bennato/peterpan: 123.txt consoli: pip_a.12.txt daniele: (2 Replies)
Discussion started by: one71
2 Replies

2. Shell Programming and Scripting

Remove blank line - SED

HI, I have this list of apps like so: DivX Products.app DivX Support.app Uninstall DivX for Mac.app Build Applet.app SpringBoard.app Interface.app MobileAddressBook.app MobileSafari.app MobileSlideShow.app Preferences.app Install Flash Player 8 OSX.app Yap.app check_afp.app ... (10 Replies)
Discussion started by: pcwiz
10 Replies

3. Shell Programming and Scripting

Unix help to find blank lines in a file and print numbers on that line

Hi, I would like to know how to solve one of my problems using expert unix commands. I have a file with occasional blank lines; for example; dertu frthu fghtu frtty frtgy frgtui frgtu ghrye frhutp frjuf I need to edit the file so that the file looks like this; (10 Replies)
Discussion started by: Lucky Ali
10 Replies

4. Shell Programming and Scripting

Print lines after the search string until blank line is found

All I want is to look for the pattern in the file...If I found it at # places... I want print lines after those pattern(line) until I find a blank line. Log EXAMPLE : MT:Exception caught The following Numbers were affected: 1234 2345 2346 Error java.lang.InternalError:... (3 Replies)
Discussion started by: prash184u
3 Replies

5. Shell Programming and Scripting

awk or sed command to print specific string between word and blank space

My source is on each line 98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies

6. Shell Programming and Scripting

Print lines between a regExp & a blank line

Hi, I have a file, say files_list, as below (o/p of ls -R cmd) $ cat files_list /remote/dir/path/to/file: sub-dir1 sub-dir2 sub-dir3 ... /remote/dir/path/to/file/sub-dir1: remote_file1.csv.tgz <blank line 1> /remote/dir/path/to/file/sub-dir2: remote_file2.csv.tgz <blank... (3 Replies)
Discussion started by: dips_ag
3 Replies

7. Shell Programming and Scripting

awk until blank space and print next line

Hello and Happy New Year 2012! I have this example: 1,2,3 4,5,6 7,8,9 For that, I'm trying to get: 1,2,3 4,5,6 7,8,9 for that, I think this might work but doesnt work so far: awk '{for(i=1;i=NF;i++);sub(/\//,"",$i);print $i}' myfile (2 Replies)
Discussion started by: Gery
2 Replies

8. Shell Programming and Scripting

String search and print next all lines in one line until blank line

Dear all I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under. i/p file: A1/EXT "BSCABD1_21233G1" 757 130823 1157 RADIO X-CEIVER ADMINISTRATION BTS EXTERNAL FAULT ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

9. Shell Programming and Scripting

sed - How to insert line before the first blank line following a token

Hello. I have a config file (/etc/my_config_file) which may content : # # port for HTTP (descriptions, SOAP, media transfer) traffic port=8200 # network interfaces to serve, comma delimited network_interface=eth0 # set this to the directory you want scanned. # * if have multiple... (6 Replies)
Discussion started by: jcdole
6 Replies

10. Shell Programming and Scripting

awk to print blank line between files

I have an AWK command that goes like this: awk '/from BOITE_AUX_LETTRES/,/end-procedure|END-PROCEDURE|end-select|END-SELECT/ {print FILENAME,FNR,$0}' *prp I get my results as follows: ZKELEXTV2.prp 16 from BOITE_AUX_LETTRES(#num_lettre) ZKELEXTV2.prp 23 LET $CONDEXTR = ' where... (2 Replies)
Discussion started by: mvalonso
2 Replies
htmlmapdriver(1grass)						Grass User's Manual					     htmlmapdriver(1grass)

NAME
HTMLMAP driver - driver to create HTML image maps. (drivers) DESCRIPTION
The HTMLMAP driver allows the generation of HTML image maps for area vector data. HTML image maps are used in conjunction with images to provide unique URL targets for different portions of an image. The HTMLMAP driver can create both client-side image maps embedded into HTML files, or server-side image maps used by web server software. Note that GRASS display commands that require the MOUSE will not work correctly (or at all!) Polygons can at most have 100 vertices (this limit imposed by HTML image map formats, see GRASS_HTMLMAXPOINTS below.) The driver will attempt to trim polygons that have more that 100 vertices by removing vertices with the least amount of angle to the next vertice. Also, any polygon that is entirely bounded by another polygon will be discarded. Text written to the driver before polygons are used as the HREF tag for all subsequent polygons written. All polygons that exist in a vec- tor map will have the same HREF tag. The only GRASS display commands that should be used with this driver are: d.text - pass href information for resulting image maps. d.vect - draw polygons from a vector map. USAGE
Environment variablesSeveral environment variables effect the operation of HTMLMAP. GRASS_WIDTH=xxx the width of the image map (default is 640). GRASS_HEIGHT=yyy the height of the image map (default is 480). GRASS_HTMLTYPE=type the type of image mape to create (default is CLIENT): CLIENT Netscape/IE client-side image map. (NAME="map") APACHE Apache/NCSA server-side image map. RAW Raw url and polygon vertices ( url x1 y1 x2 y2 format with user supplied conversion program. GRASS_HTMLFILE=filename specifies the resulting file to store the html image map, default is htmlmap. Files without absolute path names are written in the current directory where the driver was started. Any existing file of the same name is overwritten without warning. GRASS_HTMLMINDIST=n specifies the minimum distance in pixels that a point must change from the previous point to keep in the list of vertices for a polygon. The default is 2, which means that a point's x and y difference from the previous point must change by a number of pixels greater than this value. This parameter helps to eliminate closely spaced points. GRASS_HTMLMINBBOX=n specifies the minimum bounding box dimensions to record a polygon as a clickable area. The default is 2, which means that a polygon with a bounding box of less than this value is not included. This parameter helps to eliminate polygons than are a point or line. GRASS_HTMLMAXPOINTS=n specifies the maximum number of vertices included in a polygon's clickable area. The default is 99. Some browsers can only accom- modate polygons of 100 vertices or less. The HTMLMAP driver automatically ensures that a polygon is closed by making the last point the same as the first point. Typical usage Start up the driver d.mon start=HTMLMAP Display text strings (HREF's) and polygons echo "http://www.no-such-place.net/area51/" | d.text d.vect map=area51 echo "http://www.roswell-nm.net/little/green/men.html" | d.text d.vect map=roswell Stop the driver when all polygon have been displayed. This will cause a file named 'htmlmap' to be created in your current direc- tory. d.mon stop=HTMLMAP You will also want to create an image for your image map. Use the PNG driver and other utilities to create .gif or .jpg files. The following example is somewhat out of date and refers to options available in GRASS 5. # using previous GRASS_WIDTH & GRASS_HEIGHT d.mon start=PNG d.mon select=PNG d.rast map=terrain d.vect map=area51 fillcolor=white linecolor=blue d.vect map=roswell fillcolor=yellow linecolor=blue d.vect map=states color=green d.vect map=roads color=black d.mon stop=PNG # make the region the same as the newly created cell for ppm export g.region save=saved.reg g.region raster=D_cell r.out.ppm -q input=D_cell output=alien.ppm # use the netpbm utilities to create a gif (quantize if needed) ppmquant 128 <alien.ppm | ppmtogif >alien.gif # assemble some html with the image and the image map cat htmlmap >>alien.html # don't forget to reset your region g.region region=saved.reg # take a look and test it out netscape file:`pwd`/alien.html & NOTES
HTMLMAP was adapted from the CELL driver in GRASS 4.3. Point-in-polygon test code was lifted from Randolph Franklin's web page, see http://www.ecse.rpi.edu/Homepages/wrf/ http://www.ecse.rpi.edu/Homepages/wrf/research/geom/pnpoly.html If you create an HTML file with two or more images and image maps, you will need to edit the map names. The HTMLMAP driver creates its map with the name map. A small sed script can easily change the map name: sed -e 's/NAME="map"/NAME="foomap"/' < htmlmap > foomap.html SEE ALSO
Display drivers PNG driver, PostScript driver, XDRIVER d.mon, d.text, d.vect Last changed: $Date: 2010-01-20 14:26:08 +0100 (Wed, 20 Jan 2010) $ Full index (C) 2003-2011 GRASS Development Team GRASS 6.4.2 htmlmapdriver(1grass)
All times are GMT -4. The time now is 09:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy