I have searched, but I am confused | Unix Linux Forums | OS X (Apple)

  Go Back    


OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple.

I have searched, but I am confused

OS X (Apple)


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-18-2008
virgo virgo is offline
Registered User
 
Join Date: Nov 2008
Last Activity: 30 March 2009, 4:14 PM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
I have searched, but I am confused

Please forgive me if a similar question has already been asked.

I have searched and found many possible solutions to my query.
I would appreciate it if someone can point me to a thread to accomplish my task.

I am trying to change values from a Master file to a File to be modified

Since there are about thousands of entries, I am trying to do this with a script and not manually.

Here is an example of one such entry.
Master file

Code:
Y:\Music\iTunes\iTunes Music\Andain\Beautiful Things\04 Beautiful Things (Photon Project remix).mp3	Beautiful Things (Photon Project remix)	Andain	138.00

File to be modified

Code:
<ENTRY MODIFIED_DATE="2008/11/16" MODIFIED_TIME="61889" AUDIO_ID="Ajw83d3d3d3d3d3d3d2p3d3d3d3d3d3d3d3azd3d3d3uuZZmd2VVj///////////////7P///////////////e/////////////////////////////////////////////////WVnd3h3msyqh7uJiM7+3O7cy7eKqqqrzczLu6qs3d3LvN3d7///3v///////////////J///////////////+//////////////////7N7cvszf/v/v7//////////////////////////////////+7/////////////////////////////////////////////////QQAAAA==" TITLE="Beautiful Things (Photon Project remix)" ARTIST="Andain"><LOCATION DIR="/Users/virgo/Music/iTunes/iTunes Music/Andain/Beautiful Things/" FILE="04 Beautiful Things (Photon Project remix).mp3" VOLUME="Macintosh HD" VOLUMEID="Macintosh HD"></LOCATION>
<ALBUM TRACK="4" TITLE="Beautiful Things"></ALBUM>
<INFO BITRATE="320000" GENRE="Trance" LABEL="Robbins Entertainment" COMMENT="Trance" COVERARTID="112:QHQJABBQRRIX0AZ3X5NXAUFX2EXD" PLAYCOUNT="4" PLAYTIME="571" RANKING="0" IMPORT_DATE="2008/11/4" LAST_PLAYED="2008/11/7" FILESIZE="22432"></INFO>
<TEMPO BPM="137.000473" BPM_QUALITY="100"></TEMPO>
<LOUDNESS PEAK_DB="-1.1137042" PERCEIVED_DB="-2.310534"></LOUDNESS>
<CUE_V2 NAME="AutoGrid" DISPL_ORDER="0" TYPE="4" START="3.6027959554479541" LEN="0" REPEATS="-1" HOTCUE="0"></CUE_V2>
</ENTRY>

The value I need to change in this example is from:

Code:
<TEMPO BPM="137.000473"

to

Code:
<TEMPO BPM="138.00"

What would the best approach be?
awk, sed or...?

Thanks

Last edited by virgo; 11-18-2008 at 12:36 AM..
Sponsored Links
    #2  
Old 01-30-2009
otheus's Avatar
otheus otheus is offline Forum Advisor  
Smartass
 
Join Date: Feb 2007
Last Activity: 27 November 2014, 11:09 AM EST
Location: Innsbruck, Austria
Posts: 2,152
Thanks: 12
Thanked 48 Times in 45 Posts
Hopefully 2 months isn't too long to answer a question

I think sed would be better here.

Code:
sed 's/TEMPO BPM="137.000473"/TEMPO BPM="138.00"/'

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Grabbing Keywords Below a Searched Keyword jl487 Shell Programming and Scripting 8 04-24-2012 12:10 PM
greping last occurrence of the searched string vidurmittal Shell Programming and Scripting 4 07-28-2009 08:06 AM
how to get lines prior to the line being searched arunrao_oradba Shell Programming and Scripting 2 01-13-2009 03:10 PM
How to print the files names that being searched umen Shell Programming and Scripting 2 12-26-2007 02:49 AM
Unix ISO's for FTP, I've searched the other Posts killrazor UNIX for Dummies Questions & Answers 3 10-11-2002 11:05 AM



All times are GMT -4. The time now is 12:08 AM.