Sponsored Content
Full Discussion: HTML Conversion of text file
Top Forums Shell Programming and Scripting HTML Conversion of text file Post 302910132 by ctrld on Tuesday 22nd of July 2014 03:38:24 PM
Old 07-22-2014
This is quite embarrassingSmilie , I am again n trouble. I need to separate the "some text here ***" to a separate row. I tried the following but its not working. Smilie

Code:
END{ 
	dothis() 
	for(i in out)
	{
		c = "\t<td><pre>" i "</pre></td>"
		header = length(header) ? header "\n" c : c


                if ( out[i] !~ /^some text here/ ) {
                        c = "<td>\n" out[i] "\n</td>"
                        other1 = length(other1) ? other1 "\n" c : c
                }

		c = "<td>\n" out[i] "\n</td>"
		other = length(other) ? other "\n" c : c
	}

	
	print "<table>\n<tbody>\n<tr>\n" header "\n</tr>\n<tr>\n" other "\n</tr>\n</tbody>\n</table>"
}

The following output is what I trying to achieve.

Image

Last edited by ctrld; 07-22-2014 at 04:44 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ISAM FILE CONVERSION TO TEXT

I am having a problem. There is one ISAM file available in SCO UNIX environment. I want to convert it to simple comma delimited text file. Actual problem is with the size of the file. For the time being, size is 1.3 GB and I have to grab the subset of the data after every five minutes e.g. in... (3 Replies)
Discussion started by: a.waqar
3 Replies

2. UNIX for Dummies Questions & Answers

Binary data to text file conversion

Dear Sir; i want to know how the binary data convert to text file or readablw format (ASCII).If possible pl. help me for the software and where it is available for download. i.e. (1 Reply)
Discussion started by: auro123
1 Replies

3. 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

4. Shell Programming and Scripting

Converting a text file to HTML

Hi, I need to convert a text file formatted like this ("tshark -z conv,ip" output) to HTML: ===================================================================================================== IPv4 Conversations Filter:<No Filter> | <- ... (4 Replies)
Discussion started by: ph0enix
4 Replies

5. Shell Programming and Scripting

outputting a text file in html

is there anyway i can paste/cat a text file into a html paragraph <p> function html_header { cat <<END <html> <head><title>${1}</title></head> <body> <p> ${2} </p> END } function html_footer { cat <<END </body> </html> END (2 Replies)
Discussion started by: magnia
2 Replies

6. Shell Programming and Scripting

shell or perl script needed for ldif file to text file conversion

This is the ldf file dn: sdcsmsisdn=1000000049,sdcsDatabase=subscriberCache,dc=example,dc=com objectClass: sdcsSubscriber objectClass: top postalCode: 29600 sdcsServiceLevel: 10 sdcsCustomerType: 14 givenName: Adelia sdcsBlackListAll: FALSE sdcsOwnerType: T-Mobile sn: Actionteam... (1 Reply)
Discussion started by: LinuxFriend
1 Replies

7. Shell Programming and Scripting

Conversion of spaces Text file into CSV format file

Input file (each line is separaed by spaces )given below: Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- -----... (18 Replies)
Discussion started by: sreenath1037
18 Replies

8. Shell Programming and Scripting

html to csv conversion

thanks for allowing me to join your forum i have a html file with three columns ------------Last visit date , URL and link,,,,,,,, how can i convert the same into csv so that i can output into database... the mechine is linux...i made a little googling and got idea that there is ways for... (2 Replies)
Discussion started by: certteam
2 Replies

9. Shell Programming and Scripting

Conversion of a text file to html

hi i hav a file called focus. which is the output file. i want to convert this file to html file and mail it. help with code and explanatio. i am basic in unix (7 Replies)
Discussion started by: wasim999
7 Replies

10. Shell Programming and Scripting

Format text file to html

Hi Experts, Anybody out there figure out on how to achieve in shell scripts or tools. I have done googling to find solutions but no luck. I have thousands of .txt files to batch process, please see the below sample text content after -------- start here --------. What I want to achieve is to... (10 Replies)
Discussion started by: lxdorney
10 Replies
Template::Plugin::HTML(3pm)				User Contributed Perl Documentation			       Template::Plugin::HTML(3pm)

NAME
Template::Plugin::HTML - Plugin to create HTML elements SYNOPSIS
[% USE HTML %] [% HTML.escape("if (a < b && c > d) ..." %] [% HTML.element(table => { border => 1, cellpadding => 2 }) %] [% HTML.attributes(border => 1, cellpadding => 2) %] DESCRIPTION
The "HTML" plugin is a very basic plugin, implementing a few useful methods for generating HTML. METHODS
escape(text) Returns the source text with any HTML reserved characters such as "<", ">", etc., correctly esacped to their entity equivalents. attributes(hash) Returns the elements of the hash array passed by reference correctly formatted (e.g. values quoted and correctly escaped) as attributes for an HTML element. element(type, attributes) Generates an HTML element of the specified type and with the attributes provided as an optional hash array reference as the second argument or as named arguments. [% HTML.element(table => { border => 1, cellpadding => 2 }) %] [% HTML.element('table', border=1, cellpadding=2) %] [% HTML.element(table => attribs) %] DEBUGGING
The HTML plugin accepts a "sorted" option as a constructor argument which, when set to any true value, causes the attributes generated by the "attributes()" method (either directly or via "element()") to be returned in sorted order. Order of attributes isn't important in HTML, but this is provided mainly for the purposes of debugging where it is useful to have attributes generated in a deterministic order rather than whatever order the hash happened to feel like returning the keys in. [% USE HTML(sorted=1) %] [% HTML.element( foo => { charlie => 1, bravo => 2, alpha => 3 } ) %] generates: <foo alpha="3" bravo="2" charlie="1"> AUTHOR
Andy Wardley <abw@wardley.org> <http://wardley.org/> COPYRIGHT
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template::Plugin perl v5.14.2 2011-12-20 Template::Plugin::HTML(3pm)
All times are GMT -4. The time now is 02:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy