Sponsored Content
Top Forums Shell Programming and Scripting parsing a STAR tag-value file Post 302082954 by Ygor on Thursday 3rd of August 2006 09:20:43 PM
Old 08-03-2006
Try...
Code:
$ awk -v RS=: 'NR%2==0' file1
1
2
3

$ awk -v RS=: 'NR%2==1' file1
value_one
value_two
value_three

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

2. What is on Your Mind?

Did you watch Super Star (Thalaivar's) Endhiran Movie?

Robot fever is there throughout the world ! :b: (3 Replies)
Discussion started by: matrixmadhan
3 Replies

3. Red Hat

What is star

I am looking to take the Redhat Certification exam, and one of the guidelines is: Can someone tell me what star is? Thank you. (2 Replies)
Discussion started by: druidmatrix
2 Replies

4. Shell Programming and Scripting

How to retrieve the value from XML tag whose end tag is in next line

Hi All, Find the following code: <Universal>D38x82j1JJ </Universal> I want to retrieve the value of <Universal> tag as below: Please help me. (3 Replies)
Discussion started by: mjavalkar
3 Replies

5. Shell Programming and Scripting

Search for a html tag and print the entire tag

I want to print from <fruits> to </fruits> tag which have <fruit> as mango. Also i want both <fruits> and </fruits> in output. Please help eg. <fruits> <fruit id="111">mango<fruit> . another 20 lines . </fruits> (3 Replies)
Discussion started by: Ashik409
3 Replies

6. Shell Programming and Scripting

XML Parse between to tag with upper tag

Hi Guys Here is my Input : <?xml version="1.0" encoding="UTF-8"?> <xn:MeContext id="01736"> <xn:VsDataContainer id="01736"> <xn:attributes> <xn:vsDataType>vsDataMeContext</xn:vsDataType> ... (12 Replies)
Discussion started by: pareshkp
12 Replies

7. Shell Programming and Scripting

To search for a particular tag in xml and collate all similar tag values and display them count

I want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help File: <xml><object1>house</object1><object2>child</object2>... (9 Replies)
Discussion started by: srkmish
9 Replies

8. Solaris

Star/Libre/Open/???-Office for Solaris 11.2 ?

It's been a few years since this topic was last asked and answered.. curious whether anyone knows if the landscape has improved? looking for a more modern release of OpenOffice / LibreOffice / etc than the OOo-3.3 version mentioned in earlier posts from 2012. Would prefer not to compile from... (1 Reply)
Discussion started by: Yeaboem
1 Replies

9. Shell Programming and Scripting

Can't rcmd with star name

We have had a script here for years used to send files to other computers or to rcmd a command entered thru a prompt. A file we are looking for on the other computers will start with the same characters followed by -nnnnnn.txt. I can log into another computer and find (or not) that file, but not... (4 Replies)
Discussion started by: wbport
4 Replies

10. Shell Programming and Scripting

Moving XML tag/contents after specific XML tag within same file

Hi Forum. I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script. Any feedback will be greatly appreciated. ... (19 Replies)
Discussion started by: pchang
19 Replies
XmStringParseText(library call) 										   XmStringParseText(library call)

NAME
XmStringParseText -- A function that converts a character string to a compound string SYNOPSIS
#include <Xm/Xm.h> XmString XmStringParseText( XtPointer text, XtPointer *text_end, XmStringTag tag, XmTextType type, XmParseTable parse_table, Cardinal parse_count, XtPointer call_data); DESCRIPTION
XmStringParseText converts characters specified in text to corresponding components in the returned compound string. The resulting compound string consists of at least one locale or charset tag component and a series of XmString text components and other components. The conver- sion proceeds according to the parse information contained in parse_table. See the Motif Programmer's Guide for more information about parsing and parse tables. o If type is XmCHARSET_TEXT, the associated tag is interpreted as a charset name. If tag has a value of NULL, a charset component whose value is the result of mapping XmFONTLIST_DEFAULT_TAG is created. o If type is XmMULTIBYTE_TEXT or XmWIDECHAR_TEXT, the associated tag is interpreted as a language environment name. If tag has a value of NULL, a locale component with a value of _MOTIF_DEFAULT_LOCALE is created. If type is XmMULTIBYTE_TEXT or XmWIDECHAR_TEXT, tag must be NULL or _MOTIF_DEFAULT_LOCALE. XmStringParseText also scans the string for characters that have matches in parse_table. Whenever a match is found, the text up to that point is concatenated with the mapped component. text Specifies the NULL-terminated string containing characters of a type determined by type. This is updated to point to after the last character scanned. text_end Specifies a pointer into text. If a NULL is supplied to the text_end parameter, then XmStringParseText parses text until NULL is encountered, or until it reaches a point in text where it is directed to stop (for example, by a parse_proc). Otherwise, the value supplied to the text_end parameter is the pointer into text where parsing is to stop, and the returned character is the one where parsing did stop. tag Specifies the tag to be used in creating the result. The type of string tag created (charset or locale) depends on the text type and the passed in tag value. If the tag value is NULL and if type indicates that a charset string tag should be created, the string tag has the value that is the result of mapping XmFONTLIST_DEFAULT_TAG. If type indicates a locale string tag, the string tag has the value _MOTIF_DEFAULT_LOCALE. type Specifies the type of text and the tag type. If a locale tag should be created, type has a value of either XmMULTIBYTE_TEXT or XmWIDECHAR_TEXT. If type has value of XmCHARSET_TEXT, a charset tag will be created. parse_table Specifies the parse table to be used in scanning for characters to be converted to other compound string components. parse_count Specifies the number of entries in parse_table. call_data Specifies data to be passed to the parse procedures. RETURN
Returns a new compound string. The function allocates space to hold the returned compound string. When the application no longer needs the returned compound string, the application should call XmStringFree. RELATED
XmString(3), XmStringFree(3), XmParseTable(3), XmParseMapping(3). XmStringParseText(library call)
All times are GMT -4. The time now is 05:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy