Sponsored Content
Operating Systems Solaris XML value compare and replace Post 302998926 by RudiC on Friday 9th of June 2017 03:29:51 PM
Old 06-09-2017
I'm afraid this looks more complex than it actually is:
Code:
awk -vFDT=$(date -d "+1day" +"%m%d%Y%H%M") -vSDT=$(date +"%Y%m%d%H%M")  '
match ($0, /<DDD_T>[^<]*<.DDD_T>/)      {TMP = substr ($0, RSTART+7, RLENGTH-15)
                                         if (SDT >= substr (TMP, 5, 4) substr (TMP, 1, 2) substr (TMP, 3, 2) substr (TMP, 9, 4)) \
                                         sub (TMP, FDT)
                                        }
1
' file
<?xml version="1.0" encoding="UTF-8"?><PORT_REQUEST><HEADER><DDD_T>061020172129</DDD_T>

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find and replace in XML

Hi I need one clarication.. I have an xml having many entries like this.. <Cust_Name>Tom Cruise</Cust_Name> I want to rename this to <Cust_Name>TEST</Cust_Name> Pls let me know how to do it.. I was trying some basic commands like grep 'Cust_Name' * | tr '>' ',' | tr '<' ... (2 Replies)
Discussion started by: wip_vasikaran
2 Replies

2. Web Development

Replace xml values

Hallo all, I try to create a bash script but till now without any positiv results. The script should replace different variables in a text file with the right xml values Look at the following xml file: file.xml =================================== <?xml version="1.0"... (1 Reply)
Discussion started by: research3
1 Replies

3. Shell Programming and Scripting

Help with find and replace in XML

Hello Guys, I have this requirement with several hundred files. I have this first set of xml's files with the following tags spread across the file FILE in SET A <Name>Lion</Name> <Age>15</Age> ..... .... ... <Date>2009-12-12</Date> Now i have this another set of files which... (5 Replies)
Discussion started by: aixjadoo
5 Replies

4. UNIX for Advanced & Expert Users

Shell Script to compare xml files and print output to a file

All, PLease can you help me with a shell script which can compare two xml files and print the difference to a output file. I have attached one such file for you reference. <Group> <Member ID=":Year_Quad:41501" childCount="4" fullPath="PEPSICO Year-Quad-Wk : FOLDER.52 Weeks Ending Dec... (2 Replies)
Discussion started by: kanthrajgowda
2 Replies

5. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

6. Shell Programming and Scripting

Compare two xml files while ignoring some xml tags

I've got two different files and want to compare them. File 1 : <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record id="38,557"><columns><column><name>orge... (2 Replies)
Discussion started by: Shaishav Shah
2 Replies

7. Shell Programming and Scripting

Find and replace from an XML

Input-xml <weblogic-web-app> <session-descriptor> <session-param> <param-name>SysName</param-name> <param-value>smilyface</param-value> </session-param> <session-param> <param-name>InternetProtocol</param-name> <param-value>xxxxxxxx</param-value> ... (2 Replies)
Discussion started by: linuxadmin
2 Replies

8. Shell Programming and Scripting

Compare two xml files

Hi, I want to comapre two xml files in unix. 1st xml file contents <application> abc </application> <type>2</type> <type1>3</type1> 2nd xml file contents. <application> abc</application> <type>2</type> <type1>1</type1> <type2>567</type2> Desired output Differences in 1st file... (2 Replies)
Discussion started by: DeepaT
2 Replies

9. Shell Programming and Scripting

Compare two unsorted unequal files extracted from xml

I have two files for comparison which are extracts from set of xml files. file1 has: Comparing File: BRCSH1to320140224CC3.xml :: TZZZ:BR :: TAZZ:OUT UIZZ:0 :: ERAZ:1.000000 UIZZ:0 :: CTZZ:B UIZZ:0 :: CCAZ:MYR Comparing File: BRMY20140224CC18REG013SPFNSY13.xml :: TZZZ:BR :: TAZZ:INB... (1 Reply)
Discussion started by: vamsi gunda
1 Replies

10. Shell Programming and Scripting

Need to replace XML TAG

As per the requirement I need to replace XML tag with old to new on one of the XML file. Old<com : DEM>PHI</com : DEM> New<com : DEM>PHM</com : DEM> Please someone provide the sed command to replace above mentioned old XML tag with new XML tag (2 Replies)
Discussion started by: siva83
2 Replies
SVK::Log::Filter::XML(3)				User Contributed Perl Documentation				  SVK::Log::Filter::XML(3)

NAME
SVK::Log::Filter::XML - display log messages in XML format SYNOPSIS
> svk log --xml <?xml version="1.0" encoding="utf-8"?> <log> <logentry revision="1234" original="456"> <author>author</author> <date>2006-05-16T15:43:28.889532Z</date> <msg>This is the commit message for the revision.</msg> </logentry> </log> > svk log --output xml ... DESCRIPTION
The XML filter is an output filter for displaying log messages in XML format. The organization of the XML format should be self- explanatory after a little experimentation. The format is designed to be compatible with Subversion's XML output, so you should be able to use tools like <http://ch.tudelft.nl/~arthur/svn2cl/> without any modification. However, since SVK supports arbitary log filters (see SVK::Log::Filter for details on writing one), it may be easier to write your own output format than to process the XML. This filter is invoked implicitly when you specify the "--xml" argument to SVK's log command. Two arguments to the log command modify XML's behavior. quiet Providing this command-line option to the log command prevents the XML filter from displaying the contents of the log message. All other information is displayed as usual. verbose Providing this command-line option to the log command makes the XML filter display history information for each revision. The history includes the kind of modification (modify, add, delete) and any copy history for each path that was modified in the revision. STASH
/PROPERTY MODIFICATIONS XML leaves all properties and the stash intact. perl v5.10.0 2008-08-04 SVK::Log::Filter::XML(3)
All times are GMT -4. The time now is 08:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy