02-09-2009
Plain Text List to HTML List
Hello, I am trying to take a simple list (from echo, not a file) and turn it into a list with HTML codes.
List item one.
List item two.
List item three.
to
<ol>
<li>List item one.</li>
<li>List item two.</li>
<li>List item three.</li>
</ol>
The list is coming in via echo on standard input, and going to standard output.
(I am using OnMyCommand so my plan is that all I have to do is select the list, and choose the right command and it's pasted in place.
I have made some really simple commands in OMC for adding <b></b> tags around text, which is similar to this forums adding of tags. But trying to figure out sed and grep are too much for me for now. The main problem I've been having is trying to get the newlines in place, but for all intents and purposes, I'm back at square one, or should I say square zero. :-) )
I am not wed to any command line program, but it seems sed is the going to be best.
Any help appreciated! (I've searched all over and can't seem to cobble this together. I'm on OS X 10.4 and I believe bash is the default shell.)
10 More Discussions You Might Find Interesting
1. Linux
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT OSF1
xmlistpostobounds
XmListPosToBounds(3X) XmListPosToBounds(3X)
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, position, x, y, width, height)
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 asso-
ciated 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. Specifies the ID of the List widget. Specifies the position of the specified item. A
value of 1 indicates the first item in the list; a value of 2 indicates the second item; and so on. A value of 0 specifies the last item
in the list. Specifies a pointer to the returned x coordinate of the item. Specifies the pointer to the returned y coordinate of the
item. Specifies the pointer to the returned width of the item. Specifies the pointer to the returned height of the item.
For a complete definition of List and its associated resources, see XmList(3X).
RETURN VALUE
If the item at the specified position is not visible, returns False, and the returned values (if any) are undefined. Otherwise, returns
True.
SEE ALSO
XmList(3X), XmListYToPos(3X)
XmListPosToBounds(3X)