Sponsored Content
Top Forums Shell Programming and Scripting How to extract text from xml file Post 302134582 by ghostdog74 on Saturday 1st of September 2007 01:53:30 AM
Old 09-01-2007
Code:
awk '/VAL10="0">/ {	  
	  match($0,"VAL10=\"0\">")
	  v1start=RSTART
	  match($0,"</VAL>")
	  v2start=RSTART
	  print substr($0,v1start,v2start)
	}
' "file"

output:
Code:
# ./test.sh
VAL10="0">$400<BR>$400</VAL>
VAL10="0">XPOB 556-501<BR>XPOB 556-502</VAL>
VAL10="0">6/2-8/4 <BR>6/4-7/11*</VAL>
VAL10="0">S<BR>MW</VAL>
VAL10="0">This 40-hour course expands upon the topics covered in the Basic HVAC Maintenance course.<EM>Prerequisite: Basic Heating and Air Conditioning Equipment Maintenance course or instructor approval required prior to registering.</EM> Books not included</VAL>
VAL10="0">M<BR>M</VAL>
VAL10="0">*No class&nbsp;7/2-4</VAL>
VAL10="0">8 a.m.-noon<BR>8 a.m.-noon</VAL>

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract a number within an xml file

Hi Everyone, I have an sh script that I am working on and I have run into a little snag that I am hoping someone here can assist me with. I am using wget to retrieve an xml file from thetvdb.com. This part works ok but what I need to be able to do is extract the series ID # from the xml and put... (10 Replies)
Discussion started by: tret
10 Replies

2. Shell Programming and Scripting

Extract XML content from a file

310439 2012-01-11 03:44:42,291 INFO PutServlet:? - Content of the Message is:="1.0" encoding="UTF-8"?><ESP_SSIA_ACC_FEED> 310440 <BATCH_ID>12345678519</BATCH_ID> 310441 <UID>3498748823</UID> 310442 <FEED_TYPE>FULL</FEED_TYPE> 310443 <MART_NAME>SSIA_DM_TRANSACTIONS</MART_NAME> 310444... (11 Replies)
Discussion started by: arukuku
11 Replies

3. Shell Programming and Scripting

sed - extract text from xml file

hi, please help, i have an xml file, e.g: ... <tag> test text asdas="${abc}" xvxvbs:asdas${222}sdad asasa="${aa_bb_22}" </tag> ... i want to extract all "${...}", e.g: ${abc} ${222} ${aa_bb_22} thank you. (2 Replies)
Discussion started by: gioni
2 Replies

4. Shell Programming and Scripting

Extract values from an XML File

Hi, I need to capture all the attributes with delete next to it. The source XML file is attached. The output should contain something like this below: Attributes = legacyExchangeDN Action = Delete Username = Hero Joker Loginid = joker09 OU =... (4 Replies)
Discussion started by: prvnrk
4 Replies

5. Shell Programming and Scripting

Get extract text from xml file

Hi Collegue, i have a file say a.xml. it has contents <bpelFault><faultType>1</faultType><genericSystemFault xmlns=""><part name="payload"><v2:Fault... (10 Replies)
Discussion started by: Jewel
10 Replies

6. Shell Programming and Scripting

Extract a particular xml only from an xml jar file

Hi..need help on how to extract a particular xml file only from an xml jar file... thanks! (2 Replies)
Discussion started by: qwerty000
2 Replies

7. Shell Programming and Scripting

Extract Data from XML file.

Hi Guys, I am in a need to extract data from a xml file. The XML file format is as below. <data jsxnamespace="propsbundle" locales=""> <locale> <!--Error messages starts--> <record jsxid="CHARPAIR001" jsxtext=" must be selected"></record> <record... (1 Reply)
Discussion started by: Showdown
1 Replies

8. UNIX for Dummies Questions & Answers

Extract Element from XML file

<?xml version = '1.0' encoding =... (8 Replies)
Discussion started by: Siva SQL
8 Replies

9. Shell Programming and Scripting

Extract a value from an xml file

I have this XML file format and all in one line: Fri Dec 23 00:14:52 2016 Logged Message:689|<?xml version="1.0" encoding="UTF-8"?><PORT_RESPONSE><HEADER><ORIGINATOR>XMG</ORIGINATOR><DESTINAT... (16 Replies)
Discussion started by: mrn6430
16 Replies

10. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
intltool-extract(1)						   User Commands					       intltool-extract(1)

NAME
intltool-extract - generate header file from XML source file SYNOPSIS
intltool-extract [--ini-style] [--help] [--verbose] [--version] [--xml-style] [--scheme-style] source-file DESCRIPTION
intltool-extract generates header files from the strings in the specified input files which gettext can use to merge strings into the .pot file. OPTIONS
The following options are supported: --help Show usage and basic help information. You can also use -H to specify this option. --ini-style Specifies that the source file is of type gettext/ini. --scheme-style Specifies that the source file is of type gettext/scheme. You can also use -O to specify this option. --verbose Provide additional feedback. You can also use -X to specify this option. --version Show version information. You can also use -V to specify this option. --xml-style Specifies that the source file is of type gettext/xml. You can also use -O to specify this option. OPERANDS
The following operands are supported: source-file Specifies the pathname of the XML file from which to extract translatable content. EXAMPLES
Example 1: Generating a Header File for a Schemas File, With Verbose Output example% intltool-extract -O --scheme-style foo.schemas.in EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/intltool-extracThe command-line executable for the application. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-common-devel | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
intltool-merge(1), intltool-prepare(1), intltool-unicodify(1), intltool-update(1), intltoolize(1) NOTES
For more information, see the I18N-HOWTO file, which is provided with the intltool source code. Updated by Damien Donlon, Sun Microsystems Inc., 2003. Written by Darin Adler, Kenneth Christiansen, Maciej Stachowiak. SunOS 5.10 3 Apr 2003 intltool-extract(1)
All times are GMT -4. The time now is 05:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy