Dear all,
I have a database of compound words. I want to retain only strings with a single hyphen and identify those strings which have more than one hyphen. I am giving an example below
The regex/script should remove all strings which have more than one hyphen as shown in the example below where a string separated by a single hyphen alone is retained
A Perl regex or an Awk or Perl script would be of great help.
Thanks in advance
Moderator's Comments:
Please use CODE tags for sample input, sample output, and code segments (not HTML tags).
Last edited by Don Cragun; 12-05-2016 at 12:03 AM..
Reason: Change HMTL tags to CODE tags; add ICODE tags.
I'm having a couple of issues. I'm trying to edit a nagios config and remove a host definition if a certain "host_name" is found. My thought is I would find host definition block containing the host_name I'm looking for and output the line numbers for the first and last lines. Using set, I will... (9 Replies)
Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period.
Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum:
infile:
64_1535: Delm. = 86 var, aaga
64_1535: Fran. = 57 ex. ccc
64_1639: Feb. = 26 (link). def
64_1817: mar. = 3/4. drz ... (7 Replies)
There are few files in my windows directory and I need a perl script to rename the files to its original names i.e., the last extension(.orig) needs to be removed programatically,
files in directory
data1.htm.orig
data2.htm.orig
data3.htm.orig
to be renamed to
data1.htm
data2.htm... (4 Replies)
Greetings All,
I would like to find all occurences of a pattern and delete a substring from the all matching lines EXCEPT the first. For example:
1234::group:user1,user2,user3,blah1,blah2,blah3
2222::othergroup:user9,user8
4444::othergroup2:user3,blah,blah,user1
1234::group3:user5,user1
... (11 Replies)
Hello,
I have a requirement to extract the value from multiple xml node and print out the values to new file to compare.
Would be done using either awk/perl or some unix script.
For example sample input file:
.....
.....
<factories xmi:type="resources.jdbc:DataSource"... (2 Replies)
OSX
I have been grinding my teeth on a portion of code. I am building a bash script that edits a html email template. In the template, I have place holders for SED (or whatever program is appropriate) to use as anchors for find and replace, with user defined corresponding html code. The HTML code... (3 Replies)
Discussion started by: sudo
3 Replies
LEARN ABOUT HPUX
xmstringtoxmstringtable
XmStringToXmStringTable(library call) XmStringToXmStringTable(library call)
NAME
XmStringToXmStringTable -- A convenience function that converts a single compound string to a table of compound strings
SYNOPSIS
#include <Xm/Xm.h>
Cardinal XmStringToXmStringTable(
XmString string,
XmString break_component,
XmStringTable *table);
DESCRIPTION
XmStringToXmStringTable takes as input a single compound string and a specified string component (such as a tab) and returns a table of
compound strings consisting of portions of string delimited by components matching break_component. The components marking breaks will not
appear in the resulting table.
string Specifies the XmString to be converted.
break_component
Specifies the XmStringComponent that will be used to indicate where to split string to form the individual elements of table. The
most useful types will be XmSTRING_COMPONENT_SEPARATOR and XmSTRING_COMPONENT_TAB. Refer to the XmStringComponentType(3) refer-
ence page for a complete list of possible component types. Note, however, that the XmSTRING_COMPONENT_UNKNOWN component is not a
possible type.
table Returns the equivalent XmStringTable. The function will allocate space to hold the returned XmStringTable. When the applicaiton
no longer needs the returned XmStringTable, the application should call XmStringFree once for each compound string in the table,
and then calling XtFree to deallocate the XmStringTable itself.
RETURN
Returns the number of compound strings in table.
RELATED XmStringTable(3).
XmStringToXmStringTable(library call)