Error on id3v2 automation script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error on id3v2 automation script
# 1  
Old 06-15-2017
Ubuntu Error on id3v2 automation script

Hi all,
I have some audiobooks which i'm trying to add the mp3tags based using id3v2 on the folder

Example:
Abigail Gibbs - (The Dark Heroine #01) - Dinner with a Vampire
Tags that I'm hoping to write
Artist: Abigail Gibbs
Album: The Dark Heroine #01
Song: Dinner with a Vampire

Any help would be great!!


A friend tried to help me with the following but it is failing big time

Cheers
Chris

Code:
  
#!/bin/bash 
find $1 -mindepth 1 -maxdepth 1 -type d | while read i
do
#   LINE=`echo $i |sed -e "s/$1\///g" -e 's/[()]//g' -e 's/ - /-/g' |awk -F - 'BEGIN{OFS="";} {print "-a \"",$1,"\" -A \"",$2,"\" -T \"",$3,"\$
#    LINE=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/-a "\1" -A "\2" -T "\3"/'`
    LINE1=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/\1/'`
      LINEa=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/\1/'` 
      LINEA=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/\2/'` 
      LINET=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/\3/'` 
   find "$i" -type f | while read j
   do
#      echo $LINE1 \'$j\'
#echo $LINE1
echo $LINEa
echo $LINEA
echo $LINET
#echo -a \"$LINEa\" -A \"$LINEA\" -T  \"$LINET\" \'$j\'
      id3v2 -a \"$LINEa\" -A \"$LINEA\" -T  \"$LINET\" $j
#      ls "$j"
   done
done


Cheers again
# 2  
Old 06-15-2017
Code:
#!/bin/bash
find $1 -mindepth 1 -maxdepth 1 -type d | while read i
do
   LINEa=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/\1/; s/"/\\"/g;'`
   LINEA=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/\2/; s/"/\\"/g;'`
   LINET=`echo $i |sed -e "s/$1\///" -e 's/\(.*\) - (\(.*\)) - \(.*\)/\3/; s/"/\\"/g;'`
   fl=`echo "$i" |sed 's/"/\\"/g;'`
   id3v2 -a "$LINEa" -A "$LINEA" -T "$LINET" "$fl"
done


Last edited by rdrtx1; 06-15-2017 at 10:57 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automation Script for Oracle

Hi, As a Oracle Developer, I am writing many Procedures,Functions and Packages. Facing Many optimization issue after writing these Database objects. Trying to tune it manually. Can we write any Shell/Perl/Python script to Optimize these Database objects instead of doing manual check and... (1 Reply)
Discussion started by: vasuvv
1 Replies

2. Shell Programming and Scripting

Automation script

Hello All , I came across a tricky solution to devolop . Here is a part of the requirement automation . I have different set of server say : Web ( has 4 servers under it ) , App ( has 4 servers under it ) , DB ( has 2 servers under it ) Above each i have different load balancers , Say : Web... (4 Replies)
Discussion started by: radha254
4 Replies

3. Shell Programming and Scripting

awk script automation

I have the below code which calculates the time difference between src and dst from a large trace file. The code works for a given source and destination. However, I want to automate the code to go over any src and destination. The format of the source is like that: X.Y where x is always =2 and Y... (10 Replies)
Discussion started by: ENG_MOHD
10 Replies

4. Shell Programming and Scripting

Script Automation

Hi Gurus, I have a clearcase script that i use to check in a single file at time on my clearcase server. the script is as follows setmyview settask 75098_MSI_TRILOGY_EIM cd /vobs/Trilogy_R12/custom/msieim/12.0.0/sql/ cleartool co -nc . ct mkelem -nc Filename_1.sql cp... (3 Replies)
Discussion started by: r_t_1601
3 Replies

5. Shell Programming and Scripting

Boot/Shutdown script automation

Looking to automate some commands to run at boot and poweroff in a startup/shutdown script. How do I place it on the system so that it will be run automatically? I don't want to use cron, not quite specific enough, random times when I may boot or shutdown. ---------- Post updated at 10:47 PM... (8 Replies)
Discussion started by: 3therk1ll
8 Replies

6. Shell Programming and Scripting

Help with Swapinfo automation Alert script

I am new to unix scripting (HP-UX) and need to write a script for checking memory usage. I am using "ipcs -ma" and using "awk" to select specific colums and redirecting output to variable. /usr/bin/ipcs -ma | awk '{ print $5,$10,$12}' > $TMP_FILE exec < $TMP_FILE while read line; do ... (1 Reply)
Discussion started by: JamesBond007
1 Replies

7. Shell Programming and Scripting

Help with Shell Script automation

can someone look into this one please... I am struck at this point. I do not know what logic to be followed here. I can go ahead with my work only, if this step is done. Please Help. I have a process X in a shell script. Once the process X is done, it generates a log file. Process X is basically... (1 Reply)
Discussion started by: ss3944
1 Replies

8. Shell Programming and Scripting

FTP automation script

Hi, I have got a requirement like this. a parameterized function custFtp which will take 5 i/ps and will do the following tasks. p1) server name p2) username p3) password p4) path name of the server where the file resides p5) file name pattern the function will work like this. ... (1 Reply)
Discussion started by: ani_datta
1 Replies

9. Filesystems, Disks and Memory

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

10. UNIX for Dummies Questions & Answers

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies
Login or Register to Ask a Question