02-25-2010
Almost worked
Thanks for the reply Fran
The problem is that if there are more items in the file ... it only grabs the first one ... maybe because there is no NewLine ...
I will post a larger snip of the file ....
---- snip ----
<FavouriteLocations> <FavouriteLocations class="FavouriteList"><Item
class="Favourite"><DisplayName>Hem</DisplayName><Behaviour>0</Behaviour><LastUsed>2</LastUsed><StickyOrder>0</StickyOrder><Object
class="Location"><name>41837</name><name2></name2><lat>5772743</lat><long>1188701</long><entryName>Dimvädersgatan</entryName><entryLat>5772743</entryLat><entryLong>1188701</entryLong><entryHeading>-1</entryHeading><entrySideOfLine>0</entrySideOfLine><entryHouseNo>5</entryHouseNo><entryPostcode>41837</entryPostcode><entryResolved>1</entryResolved><entryValid>1</entryValid><entryMaxRoad>0</entryMaxRoad><entryHalfSize>0</entryHalfSize><source>5</source><resultType>6</resultType><photo></photo><typeName></typeName><phoneNum></phoneNum><description></description><type>road</type></Object></Item><Item
class="Favourite"><DisplayName>Färdvägsplanerare</DisplayName><Behaviour>0</Behaviour><LastUsed>3</LastUsed><StickyOrder>1</StickyOrder></Item><Item
class="Favourite"><DisplayName>Dimvädersgatan 5</DisplayName><Behaviour>1</Behaviour><LastUsed>1</LastUsed><StickyOrder>-1</StickyOrder><Object
class="Location"><name>41837</name><name2></name2><lat>5772743</lat><long>1188701</long><entryName>Dimvädersgatan</entryName><entryLat>5772743</entryLat><entryLong>1188701</entryLong><entryHeading>-1</entryHeading><entrySideOfLine>0</entrySideOfLine><entryHouseNo>5</entryHouseNo><entryPostcode>41837</entryPostcode><entryResolved>1</entryResolved><entryValid>1</entryValid><entryMaxRoad>0</entryMaxRoad><entryHalfSize>0</entryHalfSize><source>5</source><resultType>6</resultType><photo></photo><typeName></typeName><phoneNum></phoneNum><description></description><type>road</type></Object></Item><Item
class="Favourite"><DisplayName>Uttagsautomat</DisplayName><Behaviour>1</Behaviour><LastUsed>0</LastUsed><StickyOrder>-1</StickyOrder><Object
class="Location"><name>Uttagsautomat</name><name2></name2><lat>5772164</lat><long>1193476</long><entryName>Wieselgrensplatsen</entryName><entryLat>5772163</entryLat><entryLong>1193475</entryLong><entryHeading>67</entryHeading><entrySideOfLine>-1</entrySideOfLine><entryHouseNo>0</entryHouseNo><entryPostcode></entryPostcode><entryResolved>1</entryResolved><entryValid>1</entryValid><entryMaxRoad>0</entryMaxRoad><entryHalfSize>0</entryHalfSize><source>5</source><resultType>11</resultType><photo></photo><typeName>Bankomat</typeName><phoneNum></phoneNum><description></description><type>poi</type></Object></Item></FavouriteLocations></FavouriteLocations>
------- snip -------
Hope it helps a bit ... and thanks for all the help here !
/misak
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
I have this(.xml) file as:
<!-- define your instance here -->
<instance name='ins_C2Londondev' user='' group='' fullname='B2%20-%20London%20(dev)' >
<property>
</property>
</instance>
I want output as:
<!-- define your instance here -->
<instance... (3 Replies)
Discussion started by: kapilkinha
3 Replies
2. Shell Programming and Scripting
Hi
I need some help with XML file parsing. I have an XML file with the below tag,
I need a script to identify the value of srvcName which is this case is "AAA srvc name". I need to put contents of this value which is AAA srvc and name into different variables using an array and then reformat it... (6 Replies)
Discussion started by: zmfcat1
6 Replies
3. Shell Programming and Scripting
hi guys, great help to the original question, can i expand please?
i have large files filled with blocks like this
<Placemark>
network type: hot
line1
line2
line3
<styleUrl>red.png</styleUrl>
</Placemark>
<Placemark>
network type: cold
line1
line2
line3... (3 Replies)
Discussion started by: garvald
3 Replies
4. Shell Programming and Scripting
I have a large xml file as shown below:
<input>
<blah>
<blah>
<atr="blah blah value = "">
<blah>
<blah>
</input>
..2nd chunk...
..3rd chunk...
...4th chunk...
All lines between <input> and </input> is one 'order' and this 'order' is repeated... (14 Replies)
Discussion started by: shekhar2010us
14 Replies
5. Shell Programming and Scripting
Hello!
We need to parse weblogic config.xml file and display rows in format:
machine:listen-port:name:application_name
In our enviroment the output should be (one line for every instance):
Crm-Test-Web:8001:PIA:peoplesoft
Crm-Test-Web:8011:PIA:peoplesoft... (9 Replies)
Discussion started by: annar
9 Replies
6. Shell Programming and Scripting
Hello,
I have the following xml file as an input.
<?xml version="1.0" encoding="UTF-8"?>
<RECORDS PS3_VERSION="1104_01"><RECORD>
<POI_ID>931</POI_ID>
<SUPPLIER_ID>2</SUPPLIER_ID>
<POI_PVID>997920846</POI_PVID>
<DB_ID>1366650925</DB_ID>
<REGION>H1</REGION>
<POI_NAME NAME_TYPE="Official"... (4 Replies)
Discussion started by: ramky79
4 Replies
7. Shell Programming and Scripting
Hi I have an XML output like :
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <envelope>
- <body>
- <outputGetUsageSummary>
- <usgSumm rerateDone="5">
- <usageAccum accumId="269" accumCaptn="VD_DP_AR" inclUnits="9999999.00" inclUnitsUsed="0.00" shared="false" pooled="false"... (7 Replies)
Discussion started by: rkrish
7 Replies
8. Shell Programming and Scripting
I am trying to parse the XML Google contact file using tools like xmllint and I even dived into the XSL Style Sheets using xsltproc but I get nowhere.
I can not supply any sample file as it contains private data but you can download your own contacts using this script:
#!/bin/sh
# imports... (9 Replies)
Discussion started by: ripat
9 Replies
9. UNIX for Dummies Questions & Answers
I want to parse xml file
sample file.......
<name locale="en">my_name<>/name><lastChanged>somedate</lastChanged><some more code here>
<name locale="en">tablename1<>/name><lastChanged>somedate</lastChanged>
<definition><dbquery><sources><sql type="cognos">select * from... (10 Replies)
Discussion started by: ms2001
10 Replies
10. Shell Programming and Scripting
Hi,
Need help with parsing xml data in unix and place it in a csv file. My xml file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<iwgroups>
<nextid value="128">
</nextid>
<iwgroup name="RXapproval" id="124" display-name="RXapproval"... (11 Replies)
Discussion started by: ajayakunuri
11 Replies
LEARN ABOUT LINUX
git-cherry
GIT-CHERRY(1) Git Manual GIT-CHERRY(1)
NAME
git-cherry - Find commits yet to be applied to upstream
SYNOPSIS
git cherry [-v] [<upstream> [<head> [<limit>]]]
DESCRIPTION
Determine whether there are commits in <head>..<upstream> that are equivalent to those in the range <limit>..<head>.
The equivalence test is based on the diff, after removing whitespace and line numbers. git-cherry therefore detects when commits have been
"copied" by means of git-cherry-pick(1), git-am(1) or git-rebase(1).
Outputs the SHA1 of every commit in <limit>..<head>, prefixed with - for commits that have an equivalent in <upstream>, and + for commits
that do not.
OPTIONS
-v
Show the commit subjects next to the SHA1s.
<upstream>
Upstream branch to search for equivalent commits. Defaults to the upstream branch of HEAD.
<head>
Working branch; defaults to HEAD.
<limit>
Do not report commits up to (and including) limit.
EXAMPLES
Patch workflows
git-cherry is frequently used in patch-based workflows (see gitworkflows(7)) to determine if a series of patches has been applied by the
upstream maintainer. In such a workflow you might create and send a topic branch like this:
$ git checkout -b topic origin/master
# work and create some commits
$ git format-patch origin/master
$ git send-email ... 00*
Later, you can see whether your changes have been applied by saying (still on topic):
$ git fetch # update your notion of origin/master
$ git cherry -v
Concrete example
In a situation where topic consisted of three commits, and the maintainer applied two of them, the situation might look like:
$ git log --graph --oneline --decorate --boundary origin/master...topic
* 7654321 (origin/master) upstream tip commit
[... snip some other commits ...]
* cccc111 cherry-pick of C
* aaaa111 cherry-pick of A
[... snip a lot more that has happened ...]
| * cccc000 (topic) commit C
| * bbbb000 commit B
| * aaaa000 commit A
|/
o 1234567 branch point
In such cases, git-cherry shows a concise summary of what has yet to be applied:
$ git cherry origin/master topic
- cccc000... commit C
+ bbbb000... commit B
- aaaa000... commit A
Here, we see that the commits A and C (marked with -) can be dropped from your topic branch when you rebase it on top of origin/master,
while the commit B (marked with +) still needs to be kept so that it will be sent to be applied to origin/master.
Using a limit
The optional <limit> is useful in cases where your topic is based on other work that is not in upstream. Expanding on the previous example,
this might look like:
$ git log --graph --oneline --decorate --boundary origin/master...topic
* 7654321 (origin/master) upstream tip commit
[... snip some other commits ...]
* cccc111 cherry-pick of C
* aaaa111 cherry-pick of A
[... snip a lot more that has happened ...]
| * cccc000 (topic) commit C
| * bbbb000 commit B
| * aaaa000 commit A
| * 0000fff (base) unpublished stuff F
[... snip ...]
| * 0000aaa unpublished stuff A
|/
o 1234567 merge-base between upstream and topic
By specifying base as the limit, you can avoid listing commits between base and topic:
$ git cherry origin/master topic base
- cccc000... commit C
+ bbbb000... commit B
- aaaa000... commit A
SEE ALSO
git-patch-id(1)
GIT
Part of the git(1) suite
Git 1.8.5.3 01/14/2014 GIT-CHERRY(1)