Hello all. I am a newb obviously and a bit stumped on this, so any help gratefully accepted.
The script is extracting metadata from individual mp3 files, then (hopefully will be) sorting them into newly-created subdirectories. I have filtered out the relevant metadata and have the album names listed in a temporary file, one entry per line, like this -
So what I am trying to do from here is create a directory for each line.
So far I have this-
which splits everything by individual word like this -
..which is obviously not what I want. How can I get the for loop to run once for each line of input rather than once for each word?
scottn - the filtering was in order to get 'clean' album names from messy metadata. By adding quotes I thought it might make my loop process recognise one record per line rather than one per word; but it obviously did't work.
Your suggestion worked though, thanks. I didn't know exactly how/why yet, but i'll look into it!
Thanks!
Shell_life - thanks for your suggestion. I didn't follow it because I am trying to learn to shell program, and copy/pasting suggestions without understanding them at all is not much help to me, however perfect the code suggested. Thanks anyway though.
---------- Post updated at 11:28 AM ---------- Previous update was at 10:57 AM ----------
One more question then scottn, now i've looked at the code a bit more:
This line:
Obviously makes a directory called
based on the string
How does it do this? I would have thought sed or awk or something would be required to edit the line in some way, but there doesn't seem to be any utility present. Is this a function of mkdir?
Also, this doesn't work when the album name has a slash in it ie
I neead a script which converts low values to the spaces, When I used
sed -e 's/\x00/\x20/g' inputfile command it is removing the low values but not replacing it with spaces. Please help me. Its Uregent. Thanks
Sam (12 Replies)
i/o file:
abc,efg,xyz
Required o/p file:
"abc (Value + blank spaces=16) " ,"efg (Value +blank spaces=15) " ,"xyz (Value+ blank spaces =20) "
In short input file value stores in result file with " i/p Value " added with spaces and are of fixed size like 16,15,20
How to do using... (2 Replies)
my working shell is csh and even though if I try to run my script in plain sh, it behaves the same way. Here's a simple script:
#!/bin/sh
desc='"test my changes"'
cmd="echo \"$desc\""
$cmd
I want $desc to be passed as an argument to another command, but csh apparently doesn't like spaces in... (5 Replies)
Hi, i have this text:
X (m) 4917536.9627 4917536.9673 0.0090 -0.0046
Y (m) -815726.1383 -815726.1294 0.0061 -0.0089
Z (m) 3965857.4730 3965857.4840 0.0071 -0.0110
X (m) 4917536.9627 4917537.1411 -0.1784 0.1710
Y (m) -815726.1383 -815726.4859 0.3476 0.3489
Z (m) 3965857.4730... (2 Replies)
Dear all,
I'm trying to write a script where:
A file contains more or less 2000 lines. To some of those lines, in a specific position, let's say 89-92 there are spaces. So, this script should find these spaces on specific position and update a value (from 2 to 1) to another position of the... (4 Replies)
Hi,
Here is the output of lpstat. I would like to read value of Queue which is(abxxxxb1)and status that is DOWN in first line. i dont care what is in second line. any one can help me.thanks
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- ---------... (5 Replies)
Hi,
i have to form the header and add fillers(spaces) to it.
I have done something like this. i have added 10 spaces at the end
HDR="AAAABBBBCCNN "
echo $HDR >> file1.dat
but the spaces are not being stored in the file. How to add the spaces. (2 Replies)
Hi,
my var is:
PATH_LOG=/opt/WebSphere/CR Comune Roma.log
a filename which contains blank chars.
How can I call it from prompt ?
Ex:
ls $PATH_LOG or
cat $PATH_LOG
tks,
Carmen- (2 Replies)
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)