The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copying some part of file anushree.a Shell Programming and Scripting 20 12-08-2008 05:51 AM
comparing part of header with part of detailed records. cmaroju Shell Programming and Scripting 1 12-02-2008 04:45 AM
cut a part of the file kurosaki Shell Programming and Scripting 1 06-02-2008 09:14 AM
Remove part of the file chiru_h Shell Programming and Scripting 10 08-22-2007 04:15 PM
Help with multiple file rename - change case of part of file name steve7 UNIX for Dummies Questions & Answers 7 06-30-2005 01:41 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-09-2008
elbombillo elbombillo is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 48
Need to cut a part of a XML file

I want to be able to search and remove a part of this file. For Example I want to make a search for something like Terminal.app and remove the following from the XML file.

Code:
<dict>
			<key>GUID</key>
			<integer>210535539</integer>
			<key>tile-data</key>
			<dict>
				<key>dock-extra</key>
				<false/>
				<key>file-data</key>
				<dict>
					<key>_CFURLAliasData</key>
					<data>
					AAAAAAC0AAMAAQAAw+NQpgAASCsAAAAAAAAA
					gAAATbQAAMOiInsAAAAACSD//gAAAAAAAAAA
					/////wABAAgAAACAAAAAfwAOABoADABUAGUA
					cgBtAGkAbgBhAGwALgBhAHAAcAAPABoADABN
					AGEAYwBpAG4AdABvAHMAaAAgAEgARAASACNB
					cHBsaWNhdGlvbnMvVXRpbGl0aWVzL1Rlcm1p
					bmFsLmFwcAAAEwABLwD//wAA
					</data>
					<key>_CFURLString</key>
					<string>/Applications/Utilities/Terminal.app</string>
					<key>_CFURLStringType</key>
					<integer>0</integer>
				</dict>
				<key>file-label</key>
				<string>Terminal</string>
				<key>file-mod-date</key>
				<integer>3298318198</integer>
				<key>file-type</key>
				<integer>41</integer>
				<key>parent-mod-date</key>
				<integer>3304372748</integer>
			</dict>
			<key>tile-type</key>
			<string>file-tile</string>
		</dict>
From this HUGE Plist.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>mod-count</key>
	<integer>8</integer>
	<key>persistent-apps</key>
	<array>
		<dict>
			<key>GUID</key>
			<integer>210535539</integer>
			<key>tile-data</key>
			<dict>
				<key>dock-extra</key>
				<false/>
				<key>file-data</key>
				<dict>
					<key>_CFURLAliasData</key>
					<data>
					AAAAAAC0AAMAAQAAw+NQpgAASCsAAAAAAAAA
					gAAATbQAAMOiInsAAAAACSD//gAAAAAAAAAA
					/////wABAAgAAACAAAAAfwAOABoADABUAGUA
					cgBtAGkAbgBhAGwALgBhAHAAcAAPABoADABN
					AGEAYwBpAG4AdABvAHMAaAAgAEgARAASACNB
					cHBsaWNhdGlvbnMvVXRpbGl0aWVzL1Rlcm1p
					bmFsLmFwcAAAEwABLwD//wAA
					</data>
					<key>_CFURLString</key>
					<string>/Applications/Utilities/Terminal.app</string>
					<key>_CFURLStringType</key>
					<integer>0</integer>
				</dict>
				<key>file-label</key>
				<string>Terminal</string>
				<key>file-mod-date</key>
				<integer>3298318198</integer>
				<key>file-type</key>
				<integer>41</integer>
				<key>parent-mod-date</key>
				<integer>3304372748</integer>
			</dict>
			<key>tile-type</key>
			<string>file-tile</string>
		</dict>
		<dict>
			<key>GUID</key>
			<integer>1059712049</integer>
			<key>tile-data</key>
			<dict>
				<key>dock-extra</key>
				<false/>
				<key>file-data</key>
				<dict>
					<key>_CFURLAliasData</key>
					<data>
					AAAAAACyAAMAAQAAw+NQpgAASCsAAAAAAAAA
					fwAAcoEAAMOzM4YAAAAACSD//gAAAAAAAAAA
					/////wABAAQAAAB/AA4AIgAQAFQAaQBtAGUA
					IABNAGEAYwBoAGkAbgBlAC4AYQBwAHAADwAa
					AAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQA
					EgAdQXBwbGljYXRpb25zL1RpbWUgTWFjaGlu
					ZS5hcHAAABMAAS8A//8AAA==
					</data>
					<key>_CFURLString</key>
					<string>/Applications/Time Machine.app/</string>
					<key>_CFURLStringType</key>
					<integer>0</integer>
				</dict>
				<key>file-label</key>
				<string>Time Machine</string>
				<key>file-mod-date</key>
				<integer>3298318198</integer>
				<key>file-type</key>
				<integer>169</integer>
				<key>parent-mod-date</key>
				<integer>3311538379</integer>
			</dict>
			<key>tile-type</key>
			<string>file-tile</string>
		</dict>
	</array>
	<key>persistent-others</key>
	<array/>
	<key>trash-full</key>
	<false/>
	<key>version</key>
	<integer>1</integer>
</dict>
</plist>
 

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0