Sponsored Content
Full Discussion: Plain Text List to HTML List
Top Forums Shell Programming and Scripting Plain Text List to HTML List Post 302285510 by zaxxon on Monday 9th of February 2009 05:27:51 AM
Old 02-09-2009
Another one with only sed, taking input from echo:
Code:
echo -e "List item one.\nList item two.\nList item three."| sed -e '1s/^/<ol>\n/'| sed -e '1!s/^/<li>/' -e '1!s/$/<\/li>/' -e '$s/$/\n<\/ol>/' 
<ol>
<li>List item one.</li>
<li>List item two.</li>
<li>List item three.</li>
</ol>

 

10 More Discussions You Might Find Interesting

1. Linux

Plain Text printing issues

I'm attempting to print to a networked konica printer. No linux drivers that I know of exist, but we've always used HP 5si drivers and have had good results. We just loaded a box up with CentOS 5, and now when we print any sort of file from the command line (lp -dkonica <filename>), the text is... (0 Replies)
Discussion started by: fender177
0 Replies

2. UNIX for Dummies Questions & Answers

Drag and drop items in plain html page

Hello, Am looking for a tool / open source framework that could do the following. A plain html page, with some toolbox at the border of the page where the tool box contains individual tool that represents operation like "extend fleet", "add drives", "backtrack" or something of that sort. ... (1 Reply)
Discussion started by: matrixmadhan
1 Replies

3. Shell Programming and Scripting

Splitting a list @list by space delimiter so i can access it by using $list[0 ..1..2]

EDIT : This is for perl @data2 = grep(/$data/, @list_now); This gives me @data2 as Printing data2 11 testzone1 running /zones/testzone1 ***-*****-****-*****-***** native shared But I really cant access data2 by its individual elements. $data2 is the entire list, while $data,2,3...... (1 Reply)
Discussion started by: shriyer
1 Replies

4. Shell Programming and Scripting

Convert perl qw list to text file list?

Does anyone have a good example? I am having trouble looping.. Thanks (1 Reply)
Discussion started by: mrlayance
1 Replies

5. Shell Programming and Scripting

from one word for line to plain text

Hello! I've got a very big file (from tokenization) which has one word for line. How is it possible then to rebuild the "original" text, knowing that <s> and </s> are the sentence-delimiters? My file looks like this: <s> && tanzania na Afrika kwa ujumla ambiwa na taifa kubwa... (6 Replies)
Discussion started by: mjomba
6 Replies

6. Shell Programming and Scripting

Ordering HTML Drop Down List entries Alphabetically

Hi, So I have a web page that has some drop down boxes with a whole bunch of entries. Unfortunately, they have been added over time and started from a small list and is now extremely messy. I'm looking to write script so I can just copy in the section of the HTML code and have it sorted for... (6 Replies)
Discussion started by: jedel
6 Replies

7. Shell Programming and Scripting

Display both html and plain text in email in shell script

Hi, I want to display both html and plain in email in my script. i tried the below code code: export MAILTO="ssi@a.com" export CONTENT1="$htmlfile" export CONTENT2="$plainfile" export SUBJECT="INFO " export MAILFROM="si@a.com" ( echo "Subject: $SUBJECT" echo "MIME-Version:... (4 Replies)
Discussion started by: sreelu
4 Replies

8. Web Development

How to copy a selected value of list box into a text box in html form?

hi, i have a list box , a text box and a button in a html form. list box displays some values, when a user selects a value from the list box and press the button. the selected value should be copied to the text box value. can any1 give me a html and javascript code to do this facility. ... (1 Reply)
Discussion started by: Little
1 Replies

9. Shell Programming and Scripting

Add HTML tags to file list

Hi there, I am new to shell scripting and have been struggling with this example. I have an input variable that looks like that: FILELIST="100_*_123.txt" that will produce a list of files if you use ls ${FILELIST} The output looks like 100_EN_123.txt 100_FR_123.txt I am building... (4 Replies)
Discussion started by: ornesey
4 Replies

10. UNIX for Beginners Questions & Answers

Help with moving list of data to 2nd column of HTML file

Hi Team, Can you help me with writing shell script to printing the list output to 2nd column in HTML file. (2 Replies)
Discussion started by: veereshshenoy
2 Replies
XmListPosToBounds(library call) 										   XmListPosToBounds(library call)

NAME
XmListPosToBounds -- A List function that returns the bounding box of an item at a specified position in a list SYNOPSIS
#include <Xm/List.h> Boolean XmListPosToBounds( Widget widget, int position, Position *x, Position *y, Dimension *width, Dimension *height); DESCRIPTION
XmListPosToBounds returns the coordinates of an item within a list and the dimensions of its bounding box. The function returns the associ- ated x and y-coordinates of the upper left corner of the bounding box relative to the upper left corner of the List widget, as well as the width and the height of the box. The caller can pass a NULL value for the x, y, width, or height parameters to indicate that the return value for that parameter is not requested. widget Specifies the ID of the List widget. position Specifies the position of the specified item. A value of 1 indicates the first item in the list; a value of 2 indicates the sec- ond item; and so on. A value of 0 (zero) specifies the last item in the list. x Specifies a pointer to the returned x-coordinate of the item. y Specifies the pointer to the returned y-coordinate of the item. width Specifies the pointer to the returned width of the item. height Specifies the pointer to the returned height of the item. For a complete definition of List and its associated resources, see XmList(3). RETURN
If the item at the specified position is not visible, returns False, and the returned values (if any) are undefined. Otherwise, this func- tion returns True. RELATED
XmList(3) and XmListYToPos(3). XmListPosToBounds(library call)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy