Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Multiline html tag parse shell script Post 303040321 by RudiC on Saturday 26th of October 2019 12:57:47 PM
Old 10-26-2019
Why don't you paint the whole picture with your requirements (including but not limited to "get other texts out of the html", "get rid of the new lines", "replacing the commas with semicolon") and input data so people could work towards a final, optimal solution? E.g. the sed, awk, and dual tr invocations could be combined into a single run of one of the tools,
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I extract text only from html file without HTML tag

I have a html file called myfile. If I simply put "cat myfile.html" in UNIX, it shows all the html tags like <a href=r/26><img src="http://www>. But I want to extract only text part. Same problem happens in "type" command in MS-DOS. I know you can do it by opening it in Internet Explorer,... (4 Replies)
Discussion started by: los111
4 Replies

2. Shell Programming and Scripting

how to use html tag in shell scripting

Hai friends I have a small doubt.. how can we use html tag in shell scripting code : echo "<html>" echo "<body>" echo " welcome to peace world " echo "</body>" echo "</html>" output displayed like this: <html> <body> welcome to peace world </body> </html> (5 Replies)
Discussion started by: jrex1983
5 Replies

3. UNIX for Advanced & Expert Users

shell script to parse html file

hi all, i have a html file something similar to this. <tr class="evenrow"> <td class="data">added</td><td class="data">xyz@abc.com</td> <td class="data">filename.sql</td><td class="modifications-data">08/25/2009 07:58:40</td><td class="data">Added TK prof script</td> </tr> <tr... (1 Reply)
Discussion started by: sais
1 Replies

4. Shell Programming and Scripting

Parse HTML tag parameters and text

Hi! I have a bunch of HTML files, which I want to parse to CSV files. Every page has a table in it, and I need to parse each row into a csv record. With awk and sed, I managed to put every table row in separate lines. So my file looks like this: <TR> .... </TR> <TR> .... </TR> ...One... (1 Reply)
Discussion started by: senszey
1 Replies

5. Shell Programming and Scripting

Script to delete HTML tag

Guys, I have a little script that I got of the internet and that I use in Squid to block ads. I used that script with linux but now i have moved my servers to freebsd. I have a step learning curve there but it is fun: Back to the script issue. The script used to work i with linux but... (15 Replies)
Discussion started by: zongo
15 Replies

6. Shell Programming and Scripting

awk Script to parse a XML tag

I have an XML tag like this: <property name="agent" value="/var/tmp/root/eclipse" /> Is there way using awk that i can get the value from the above tag. So the output should be: /var/tmp/root/eclipse Help will be appreciated. Regards, Adi (6 Replies)
Discussion started by: asirohi
6 Replies

7. Shell Programming and Scripting

Search for a html tag and print the entire tag

I want to print from <fruits> to </fruits> tag which have <fruit> as mango. Also i want both <fruits> and </fruits> in output. Please help eg. <fruits> <fruit id="111">mango<fruit> . another 20 lines . </fruits> (3 Replies)
Discussion started by: Ashik409
3 Replies

8. Shell Programming and Scripting

Using shell command need to parse multiple nested tag value of a XML file

I have this XML file - <gp> <mms>1110012</mms> <tg>988</tg> <mm>LongTime</mm> <lv> <lkid>StartEle=ONE, Desti = Motion</lkid> <kk>12</kk> </lv> <lv> <lkid>StartEle=ONE, Source = Velocity</lkid> <kk>2</kk> </lv> <lv> ... (3 Replies)
Discussion started by: NeedASolution
3 Replies

9. Shell Programming and Scripting

XML Parse between to tag with upper tag

Hi Guys Here is my Input : <?xml version="1.0" encoding="UTF-8"?> <xn:MeContext id="01736"> <xn:VsDataContainer id="01736"> <xn:attributes> <xn:vsDataType>vsDataMeContext</xn:vsDataType> ... (12 Replies)
Discussion started by: pareshkp
12 Replies

10. Shell Programming and Scripting

How to remove html tag which has multiple lines in SHELL?

I want to clean a html file. I try to remove the script part in the html and remove the rest of tags and empty lines. The code I try to use is the following: sed '/<script/,/<\/script>/d' webpage.html | sed -e 's/<*>//g' | sed '/^\s*$/d' > output.txt However, in this method, I can not... (10 Replies)
Discussion started by: YuhuiFeng
10 Replies
TMESH2RAD(1)						      General Commands Manual						      TMESH2RAD(1)

NAME
tmesh2rad - convert a triangular mesh to a RADIANCE scene description SYNOPSIS
tmesh2rad [ -o obj ][ -m mat ][ -p pat ] [ input .. ] DESCRIPTION
Tmesh2rad converts one or more triangle-mesh files to a RADIANCE scene description. The -o option may be used to assign a default object name. The single letter "T" is used if no name is given on the command line or in the file. The -m option may be used to assign a default material name. The non-material "void" is used as a default if none is given on the command line or in the file. The -p option may be used to assign a default picture for a surface pattern. If none is given on the command line or in the file, the surface will not have an associated pattern. FILE FORMAT
A triangle-mesh is a free-format ASCII file composed of the following eight primitive types. Each primitive is begun with a single, white- space-delimited letter: # Comment Whatever follows up until the end of line is passed as a comment to the output. Note that there must be at least one space or tab following the pound-sign. o name The white-space-delimited string name is used as a prefix for all following output triangles. m material The white-space-delimited string material is used as the modifier name for all following output triangles. p picture The white-space-delimited string picture is used as the name of the RADIANCE picture file to be used as a pattern for all follow- ing output triangles with properly defined vertices. (See i primitive below.) v id x y z Defines the vertex id with 3-dimensional coordinates x, y and z. The identifier, id must be some small, non-negative integer value. If the same integer is used for a later vertex definition, this definition will be lost, though any triangles using the vertex prior to its redefinition will be unaffected. n nx ny nz Defines a surface normal vector with the 3-dimensional components nx, ny and nz. This vector will be associated with the most recently defined vertex, and is often placed on the same line as the vertex definition for clarity. The vector need not be nor- malized. i u v Defines a picture index for the most recently defined vertex. The u value will be used to lookup the horizontal pixel coordinate in the currently defined picture. The v value will be used to lookup the vertical pixel coordinate. (See the RADIANCE reference manual for details on picture coordinate values.) As with associated surface normals, picture indices are interpolated using barycentric coordinates based on the triangle vertices. If these coordinates are calculated correctly, this should result in a smooth mapping of a pattern onto the surface mesh. t id1 id2 id3 Create a triangle connecting the three vertices identified by id1, id2 and id3. The right-hand rule is used to determine the default surface normal orientation, and this should not be too far from the associated vertex normals (if any). All three ver- tices must have an associated normal if the triangle is to be smoothed. If a picture file is defined and all three vertices have pattern indices associated with them, then this picture will be used as a pattern to modify the triangle's color. We realize there are many similar T-mesh file formats in existence, and that it would have been just as easy to support one of these for- mats directly. The disadvantage to supporting an existing format is that conversion from other formats might prove difficult. It was our hope to provide a "greatest common multiple" format that would support all similar T-mesh formats, rather than supporting WaveFront's .obj format (for example) and being unable to associate a pattern with an object. Converting from other formats should be relatively straight- forward. In many cases, an awk(1), rcalc(1) or even a sed(1) script should be sufficient. EXAMPLE
Here is an example T-mesh file: # Our object name: o test_object # Our material: m puce # Our vertices: v 1 10 15 5 v 2 10 -15 5 v 3 0 -15 0 v 4 -10 15 -5 # Two triangles joined together: t 1 2 3 t 2 3 4 Which generates the following output: ## T-mesh read from: <stdin> # Our material: # Our vertices: # Two triangles joined together: puce polygon test_object.1 0 0 9 10 15 5 10 -15 5 0 -15 0 puce polygon test_object.2 0 0 9 10 -15 5 0 -15 0 -10 15 -5 Here is another example: # A partial cylinder: m BluePlastic v 1 -14.673 -3.119 50 n -0.95677 -0.203374 1.17936e-10 v 2 -12.136 -8.817 -50 n -0.791363 -0.574922 4.84915e-10 v 3 -12.136 -8.817 50 n -0.791363 -0.574922 4.84915e-10 t 1 2 3 m OrangePlastic v 1 -7.501 -12.991 50 n -0.549094 -0.812427 -1.45812e-09 v 2 -12.136 -8.817 50 n -0.791363 -0.574922 4.84915e-10 v 3 -12.136 -8.817 -50 n -0.791363 -0.574922 4.84915e-10 t 1 2 3 m BluePlastic v 1 -1.568 -14.918 50 n -0.171094 -0.965568 -5.69788e-09 v 2 -7.501 -12.991 50 n -0.549094 -0.812427 -1.45812e-09 v 3 -7.501 -12.991 -50 n -0.429001 -0.881759 -3.6502e-09 t 1 2 3 Note that the same three vertices were used repeatedly, and intermingled with the triangle definitions. AUTHOR
Greg Ward BUGS
Triangle smoothing doesn't work very well for glass or trans material types in Radiance, since textures cause distorted transmission through these materials. It is best to use the dielectric material type if smooth transmission is desired. SEE ALSO
arch2rad(1), awk(1), ies2rad(1), thf2rad(1), oconv(1), rcalc(1), sed(1), xform(1) RADIANCE
3/18/96 TMESH2RAD(1)
All times are GMT -4. The time now is 11:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy