08-06-2008
removing empty tags
Hi,
I have a file as shown below.
<crown:clinicalData>
<crown:alb date="2008-07-10" lowValue="3.50" method="BCG" value="3.50"/>
<crown:cre date="2008-07-10" value="9.5"></crown:cre>
<crown:ktvHdAd>
</crown:ktvHdAd>
<crown:ktvPdAd>
</crown:ktvPdAd>
</crown:clinicalData>
I want to remove the empty tags. i.e I want to remove
<crown:ktvHdAd>
</crown:ktvHdAd>
and
<crown:ktvPdAd>
</crown:ktvPdAd>
If it happens to have records in between the tags, then I do not want to delete.
Can any of you know good approaches to it?
Thanks
Vijay
10 More Discussions You Might Find Interesting
1. Programming
I have a file which contains numbers as follows:
1234 9876 6789 5677 3452
9087 4562 1367 2678 7891
I need to remove the empty spaces and add commas between the numbers like:
1234,9876,6789,5677,3452,
9087,4562,1367,2678,7891
Can anyone tell me the command to do... (4 Replies)
Discussion started by: jazz
4 Replies
2. UNIX for Dummies Questions & Answers
I used to be able to do the following command on HP while largefile was being written to.
> echo " " > largefile
When I try the same on Solaris I get a message that the file already exists.
Is there a parameter that I need to setup in my env ?
Thanks in advance (8 Replies)
Discussion started by: jxh461
8 Replies
3. UNIX for Dummies Questions & Answers
Hi
I'm trying to remove empty sub-folders from 1 main folder using the find method, but the "- empty" parameter isn't recognized by my Unix version.
Any idea how to implement such thing?
Thanks. (3 Replies)
Discussion started by: biot
3 Replies
4. UNIX for Dummies Questions & Answers
Hey there!
I try to use 'find' to remove empty directories like this:
find . -depth -type d -empty -exec rm -rf {} ';'
It works just fine, but there are some directories i want to exclude.
So i tried to do sth like this:
find . -depth -type d -empty -exec grep -v "not this one please" -exec... (5 Replies)
Discussion started by: deTTo
5 Replies
5. Shell Programming and Scripting
Hi,
Please provide shell script to Remove empty lines(space) between two lines containing strings in a file.
Input File :
A1/EXT "BAP_BSC6/07B/00" 844 090602 1605
RXOCF-465 PDTR11 1
SITE ON BATTERY
A2/EXT... (3 Replies)
Discussion started by: sudhakaryadav
3 Replies
6. Ubuntu
Hi,
I am getting this warning messages when I run dpkg --purge
dpkg -r
apt-get remove --purge
aptitude purge with sudo permission to remove completely a custom application that is installed through debian dpkg command. Some of the directories in that package install path is still left out... (0 Replies)
Discussion started by: royalibrahim
0 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I have a folder that contains all my music. Recently, I started using a different media player, and I let it manage my music folder. It has sorted all my music neatly in folders by artist and album. However, all the old folders that the songs used to be in are still there, yet they are... (2 Replies)
Discussion started by: emveedee
2 Replies
8. UNIX for Dummies Questions & Answers
I'm trying to remove all of the empty lines at the end of a Tab delimited file. They have no data just tabs.
I've tried may things, here are a couple:
sed /^\t.\t/d File1 > File2
sed /^\t{44}/d File1 > File2
What am I missing? (9 Replies)
Discussion started by: SirHenry1
9 Replies
9. Shell Programming and Scripting
How to write in awk to remove lines starting with "#" and then process the file:
This is not working:
cat file|awk '{if ($0 ~ /^#/) $0="";print NF>0}'
When I just give cat file|awk '{if ($0 ~ /^#/) $0="";print }'
it prints the blank lines . I don't wnat the blank lines along with the... (15 Replies)
Discussion started by: rveri
15 Replies
10. Shell Programming and Scripting
Hi - I have req to join broken lines and remove empty lines but should NOT be in one line. It has to be as is line by line. The challenge here is there is no end of line/start of line char.
thanks in advance
Source:-
2003-04-34024|04-10-2003|Claims|Claim|01-13-2003|Air Bag:Driver;... (7 Replies)
Discussion started by: Jackceasar123
7 Replies
pfstag(1) General Commands Manual pfstag(1)
NAME
pfstag - Set or remove tags to/from pfs stream
SYNOPSIS
pfstag [--set [channel:]name=value] [--remove [channel:]name]
DESCRIPTION
Use this command to set or remove tags from the pfs-stream. Tags are used to add additional information to pfs frames and they are in the
format: 'name=value'. To learn more about tags, read 'Specification of the PFS File Format'.
Tags are set/removed to/from all pfs frames in the stream.
Note that currently only OpenEXR file format supports tags.
OPTIONS
--set [channel:]name=value], -s [channel:]name=value], --add [channel:]name=value]
Change existing or add a new tag of the given name. If no channel is given, tags are added to the frame.
--remove [channel:]name], -r [channel:]name]
Remove tag of the given name. Ignore if the tag does not exist. If no channel is given, tags are removed from the frame.
EXAMPLES
pfsin memorial.hdr | pfstag --add "EXTRA_INFO=foo" | pfsout memorial_ei.exr
Add tag "EXTRA_INFO=foo" to the memorial image and save it as memorial_ei.exr.
SEE ALSO
pfsin(1) pfsout(1)
BUGS
Please report bugs and comments to Rafal Mantiuk <mantiuk@mpi-sb.mpg.de>.
pfstag(1)