Sponsored Content
Top Forums Shell Programming and Scripting Change Hex character strings to HTML entities Post 302412476 by alister on Monday 12th of April 2010 04:52:12 PM
Old 04-12-2010
Hello, pinocchio:

Code:
$ cat data
label.Asked=\u8CEA\u554F\u6E08\u307F
button.Edit=\u7DE8\u96C6
data.menu.WorkWeekProfile=<li>\u5E73\u65E5\u30D7<b>\u30ED\u30D5</b>\u30A3\u30FC\u30EB</li>

$ sed 's/\\u\([[:xdigit:]]\{4\}\)/\&#x\1;/g; s/$/<br \/>/' data
label.Asked=&#x8CEA;&#x554F;&#x6E08;&#x307F;<br />
button.Edit=&#x7DE8;&#x96C6;<br />
data.menu.WorkWeekProfile=<li>&#x5E73;&#x65E5;&#x30D7;<b>&#x30ED;&#x30D5;</b>&#x30A3;&#x30FC;&#x30EB;</li><br />

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Looking for a hex character?

Hi guys , i would want to count the concurrences of the 0A hex char in a text file , then if no matches i need to add a 0A at the end of the line. Any ideas? thx.Regards (1 Reply)
Discussion started by: Klashxx
1 Replies

2. UNIX for Dummies Questions & Answers

How do I get past an HTML::entities discrepancy on an RPM?

I have an RPM that I am trying to install and it keeps coming back with: I know I could kill the bird by throwing a "yum install *perl*" at it, but this seems like hurling a skyscraper at an ant... any better suggestions? (2 Replies)
Discussion started by: jjinno
2 Replies

3. UNIX for Dummies Questions & Answers

delete newline character between html tags

Hi, I have learned some of the Unix commands a way back and not sure of how to code them when needed in certain way, especially sed command. Here is my situation. I have an xml file with several tags. most of the tags start on the same line and end on the same line. However, data for some tags... (8 Replies)
Discussion started by: girish312
8 Replies

4. UNIX for Advanced & Expert Users

Convert UTF-8 encoded hex value to a character

Hi, I have a non-ascii character (Ŵ), which can be represented in UTF-8 encoding as equivalent hex value (\xC5B4). Is there a function in unix to convert this hex value back to display the charcter ? (10 Replies)
Discussion started by: sumirmehta
10 Replies

5. UNIX for Dummies Questions & Answers

Help to replace character strings

Hello Can Any1 help me. I want to replace a specific character string inside a file at a specific location with a particular character with the help of a command or a shell script. The tr command replaces a specific character with another for all the occurences of that character in the file. I... (5 Replies)
Discussion started by: rahulrathod
5 Replies

6. UNIX for Dummies Questions & Answers

Getting strings before and after a character

OK This one has me stumped. I have the following line, program name - the program description that can also contain a hyphen - character. I'm need to separate the "program name" from the program description. I've tried using an array function with the - as delimiter, but I ran into a... (2 Replies)
Discussion started by: ricksj
2 Replies

7. Programming

After converting the hexstr to Hex and storing the Hex in a char*

Hi All, My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ',' This has to be done for all the hexstring char* is NULL. Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Discussion started by: rvan
1 Replies

8. UNIX for Dummies Questions & Answers

character-by-character comparison of strings

This might be a dummy question, but is there a command in UNIX that compare two strings character-by-character and display the difference? ---------- Post updated at 11:25 AM ---------- Previous update was at 10:32 AM ---------- Or probably what I'm looking is how to break a string into... (3 Replies)
Discussion started by: Orbix
3 Replies

9. Programming

What is the difference between ios::hex and std::hex?

Hi, Is there really a difference between these two, std::hex and ios::hex?? I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true? Thanks (0 Replies)
Discussion started by: royalibrahim
0 Replies

10. Shell Programming and Scripting

Extract expressions between two strings in html file

Hello guys, I'm trying to extract all the expressions between the following tags: <b></b> from a HTML file. This is how it looks: big lines containing several dozens expressions (made of 1,2,3,4,6 or even 7 words) I would like to extract: <b>bla ble</b>bla ble</td><tr valign="top"><td... (3 Replies)
Discussion started by: bobylapointe
3 Replies
XmVaCreateSimplePopupMenu(library call) 								   XmVaCreateSimplePopupMenu(library call)

NAME
XmVaCreateSimplePopupMenu -- A RowColumn widget convenience creation function SYNOPSIS
#include <Xm/RowColumn.h> Widget XmVaCreateSimplePopupMenu( Widget parent, String name, XtCallbackProc callback); DESCRIPTION
XmVaCreateSimplePopupMenu creates an instance of a RowColumn widget of type XmMENU_POPUP and returns the associated widget ID. This rou- tine uses the ANSI C variable-length argument list (varargs) calling convention. This routine creates a Popup menu pane and its button children. The name of each button is button_n, where n is an integer from 0 (zero) to the number of buttons in the menu minus 1. The name of each separator is separator_n, where n is an integer from 0 (zero) to the number of separators in the menu minus 1. The name of each title is label_n, where n is an integer from 0 (zero) to the number of titles in the menu minus 1. Buttons, separators, and titles are named and created in the order in which they are specified in the variable portion of the argument list. parent Specifies the widget ID of the parent of the MenuShell name Specifies the name of the created widget callback Specifies a callback procedure to be called when a button is activated or when its value changes. This callback function is added to each button after creation. For a CascadeButtonGadget or a PushButtonGadget, the callback is added as the button's XmN- activateCallback, and it is called when the button is activated. For a ToggleButtonGadget, the callback is added as the button's XmNvalueChangedCallback, and it is called when the button's value changes. The button number is returned in the client_data field. The variable portion of the argument list consists of groups of arguments. The first argument in each group is a constant or a string and determines which arguments follow in that group. The last argument in the list must be NULL. The following list describes the possible first arguments in each group of varargs. XmVaCASCADEBUTTON This is followed by two additional arguments. The set specifies one button in the PopupMenu and some of its resource values. The button created is a CascadeButtonGadget. Following are the additional two arguments, in order: label The label string, of type XmString mnemonic The mnemonic, of type KeySym XmVaPUSHBUTTON This is followed by four additional arguments. The set specifies one button in the PopupMenu and some of its resource values. The button created is a PushButtonGadget. Following are the additional four arguments, in order: label The label string, of type XmString mnemonic The mnemonic, of type KeySym accelerator The accelerator, of type String accelerator_text The accelerator text, of type XmString XmVaRADIOBUTTON This is followed by four additional arguments. The set specifies one button in the PopupMenu and some of its resource values. The button created is a ToggleButtonGadget. Following are the additional four arguments, in order: label The label string, of type XmString mnemonic The mnemonic, of type KeySym accelerator The accelerator, of type String accelerator_text The accelerator text, of type XmString XmVaCHECKBUTTON This is followed by four additional arguments. The set specifies one button in the PopupMenu and some of its resource values. The button created is a ToggleButtonGadget. Following are the additional four arguments, in order: label The label string, of type XmString mnemonic The mnemonic, of type KeySym accelerator The accelerator, of type String accelerator_text The accelerator text, of type XmString XmVaTITLE This is followed by one additional argument. The pair specifies a title LabelGadget in the PopupMenu. Following is the additional argument: title The title string, of type XmString XmVaSEPARATOR This is followed by no additional arguments. It specifies one separator in the PopupMenu. XmVaDOUBLE_SEPARATOR This is followed by no additional arguments. It specifies one separator in the PopupMenu. The separator type is XmDOUBLE_LINE. resource_name This is followed by one additional argument, the value of the resource, of type XtArgVal. The pair specifies a resource and its value for the RowColumn widget. XtVaTypedArg This is followed by four additional arguments. The set specifies a resource and its value for the RowColumn widget. A resource type conversion is performed if necessary. Following are the additional four arguments, in order: name The resource name, of type String type The type of the resource value supplied, of type String value The resource value (or a pointer to the resource value, depending on the type and size of the value), of type XtArgVal size The size of the resource value in bytes, of type int XtVaNestedList This is followed by one additional argument of type XtVarArgsList. This argument is a nested list of varargs returned by XtVaCre- ateArgsList. For more information on variable-length argument lists, see the X Toolkit Intrinsics documentation. A number of resources exist specifically for use with this and other simple menu creation routines. For a complete definition of RowColumn and its associated resources, see XmRowColumn(3). RETURN
Returns the RowColumn widget ID. RELATED
XmCreatePopupMenu(3), XmCreateRowColumn(3), XmCreateSimplePopupMenu(3), and XmRowColumn(3). XmVaCreateSimplePopupMenu(library call)
All times are GMT -4. The time now is 05:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy