Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > NZ Computing > You guys seem pretty smart....

Reply
Thread Tools

You guys seem pretty smart....

 
 
Andrew
Guest
Posts: n/a
 
      09-10-2005
Harry wrote:
> Andrew wrote:
>
>
>>Im sure this is possible, Im just not sure how to do it
>>
>>i have a text file called "list"
>>
>>it contains:
>>bldg_whitehallBuildingAnnex 263341
>>bldg_woolworth 262737
>>Queensboro 248950
>>Williamsburg 248948
>>Brooklyn 255674
>>
>>i also have a script called uid2mov.pl which uses the numbers in the
>>above list to get a directory location relative to the number
>>
>>Ive used this command on the list:
>>cat list | awk '{system (" ~alambert/scripts/uid2mov.pl " $2)}' | awk
>>'{system ("cp " $1" /vol/tempwrangler/andrew/hannah1/")}'

>
>
> That is crazy!
> You should just use:
>
> while read dir num
> do
> mv $dir /vol/tempwrangler/andrew/hannah1/
> done <list
>
>
>>which executes:
>>cp
>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>/vol/tempwrangler/andrew/hannah1/
>>cp
>>/vol/shotsub/Movies/kong/Assets/hybridWoolworth/kong_Assets_hybridWoolworth_Take-4.1k.mov
>>/vol/tempwrangler/andrew/hannah1/
>>cp
>>/vol/shotsub/Movies/kong/Assets/queensboroBridge/kong_Assets_queensboroBridge_Take-3.1k.mov
>>/vol/tempwrangler/andrew/hannah1/
>>cp
>>/vol/shotsub/Movies/kong/Assets/williamsburgBridge/kong_Assets_williamsburgBridge_Take-2.1k.mov
>>/vol/tempwrangler/andrew/hannah1/
>>cp
>>/vol/shotsub/Movies/kong/Assets/brooklynBridge/kong_Assets_brooklynBridge_Take-2.1k.mov
>>/vol/tempwrangler/andrew/hannah1/
>>
>>
>>My question is... how to get a different output, ie putting the numbers
>>from the list into the destination filename:
>>cp
>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>/vol/tempwrangler/andrew/hannah1/kong_Assets_hybrid_Take-28.1k.263341.mov
>>
>>all Using a single line command
>>
>>from the answer i can probably work out how to make it:
>>cp
>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>/vol/tempwrangler/andrew/hannah1/kong_Assets_hybrid_Take-28.1k.263341_bldg_whitehallBuildingAnnex.mov
>>
>>note, i already have a script that does all of this, Im just reasonably
>>new to awk and i was wondering what i needed to add to the command to
>>get what i want
>>
>>in fact im new to linux all together, so most commands i dont actually
>>know about

>
>
> How about:
>
> while read item num
> do
> mv /vol/shotsub/Movies/kong/Assets/williamsburgBridge/kong_Assets_$item-* /vol/tempwrangler/andrew/hannah1/
> done <list
>
> Or something like that.
> It really is simple, so you should keep it simple.
>

Im unable to do this as i need to use the script -
alambert/scripts/uid2mov.pl with the 6 digit number in order to resolve
the location of the .mov file

So essentially first i need to run uid2mov.pl <number> to get the
/vol/shotsub/Movies/kong/Asse.... etc and i then need to attach that
same number and posisbly its description from the original list

 
Reply With Quote
 
 
 
 
Andrew
Guest
Posts: n/a
 
      09-10-2005
Lawrence DčOliveiro wrote:
> In article <2UqUe.10274$>,
> Andrew <> wrote:
>
>
>>Im sure this is possible, Im just not sure how to do it
>>
>>i have a text file called "list"
>>
>>it contains:
>>bldg_whitehallBuildingAnnex 263341
>>bldg_woolworth 262737
>>Queensboro 248950
>>Williamsburg 248948
>>Brooklyn 255674
>>
>>i also have a script called uid2mov.pl which uses the numbers in the
>>above list to get a directory location relative to the number
>>
>>Ive used this command on the list:
>>cat list | awk '{system (" ~alambert/scripts/uid2mov.pl " $2)}' | awk
>>'{system ("cp " $1" /vol/tempwrangler/andrew/hannah1/")}'

>
>
> I don't think I would bother with awk for this. bash should be powerful
> enough for the job.
>
> First of all, you should be able to separate out the lines of the file
> as follows:
>
> SAVEIFS="$IFS"; IFS=$'\n'
> declare -a lines; lines=($(< list))
> IFS="$SAVEIFS"
>
> Then you can iterate over the entries something like:
>
> for ((i=0; i < ${#lines[*]}; ++i))
> do
> parms=(${lines[$i]})
> cp $(~alambert/scripts/uid2mov.pl ${parms[1]}) \
> /vol/tempwrangler/andrew/hannah1/kong_Assets_ ${parms[1]}.
> ${parms[0]}.mov
> done
>
> (Haven't tested this!) Not sure if that gives exactly the file names you
> want, though.
>
> If you want more complex construction of destination filenames from
> source ones, I would recommend using a Perl script.

Yup, i realise this, i have a perl script already to do this

my intention with this post is to see if awk or something else could do
it - single lined command line - okay a long line at that

 
Reply With Quote
 
 
 
 
Andrew
Guest
Posts: n/a
 
      09-10-2005
Shane wrote:
> On Sat, 10 Sep 2005 13:44:30 +1200, Andrew wrote:
> Hi andrew,
> What you want is to add regular expressions into your awk statements,
> specifically you are looking at
> awk ' {sub(/$/,"$2")}'
>
> http://www.student.northpark.edu/pem...k/awk1line.txt
>
> Im not too handy with awk at all (in fact I got the above from google)
> the substitution means as follows
> sub <<-- no prizes here
> /$/ <<-- at the end of the line
> "$2" <<-- Im guessing you can pass $2 (which contains the info you want
> added to the end of the line)
>
> Also Im not sure if you want everyone to know your full name and place of
> work (although working in mirimar is something to be proud of indeed
> so a bit of judicious snipping might be in order in future
> HTH
>
>



Cheers, I will take a look and see if it does what i need

I cant say im too fussed about the information contained.. as its
nothing universal will jump up and down about

Plus - after we are done here who knows where i will be!
 
Reply With Quote
 
daemon9
Guest
Posts: n/a
 
      09-11-2005
On Sat, 10 Sep 2005 23:57:07 +1200, H.O.G wrote:

> On Sat, 10 Sep 2005 23:30:26 +1200, Brendan <>
> spoke these fine words:
>
>>On Sat, 10 Sep 2005 22:15:33 +1200, Shane wrote:
>>
>>>> What's that, stalker?
>>>>
>>>> Bit hot under the collar, there, turniphead?
>>>
>>> It appears you are, go have a lie down before you make a dick of yourself
>>> *again*

>>
>>He sure does.
>>
>>> Before you rush off though, why do you call misfit a convict, yet tell
>>> Michael George that you yourself have smoked pot and feel its a victemless
>>> crime?
>>> Are you that low?

>>
>>Yes he is. You need to understand the psychology of damaged people like
>>him:
>>
>>He's basically an insecure spotty little reject. He is trying to build his
>>self esteem up by harassing and putting others down. He even INVENTS
>>complaints in order to do so.
>>
>>He might be tolerated if he actually KNEW what he was talking about. But I
>>doubt he'd be tolerated even then.
>>
>>Woger has the excuse of being senile. Poor excuse that it is, he is at
>>least useful once or twice a year (even a busted watch is right twice a
>>day).
>>
>>HOG does not have these excuses. He is either deliberately an arrogant,
>>ignorant little ****tard hypocrite or he has run out of his Ritalin.
>>
>>Either way, ignore him.

>
> LOL! Thanks for the comedy, knobby.
>
> I only "put down" people who abuse me first.


So why arn't you fighting back you a spineless wuss?

d9
 
Reply With Quote
 
Harry
Guest
Posts: n/a
 
      09-11-2005
Andrew wrote:

> Harry wrote:
>> Andrew wrote:
>>
>>
>>>Im sure this is possible, Im just not sure how to do it
>>>
>>>i have a text file called "list"
>>>
>>>it contains:
>>>bldg_whitehallBuildingAnnex 263341
>>>bldg_woolworth 262737
>>>Queensboro 248950
>>>Williamsburg 248948
>>>Brooklyn 255674
>>>
>>>i also have a script called uid2mov.pl which uses the numbers in the
>>>above list to get a directory location relative to the number
>>>
>>>Ive used this command on the list:
>>>cat list | awk '{system (" ~alambert/scripts/uid2mov.pl " $2)}' | awk
>>>'{system ("cp " $1" /vol/tempwrangler/andrew/hannah1/")}'

>>
>>
>> That is crazy!
>> You should just use:
>>
>> while read dir num
>> do
>> mv $dir /vol/tempwrangler/andrew/hannah1/
>> done <list
>>
>>
>>>which executes:
>>>cp
>>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>>/vol/tempwrangler/andrew/hannah1/
>>>cp
>>>/vol/shotsub/Movies/kong/Assets/hybridWoolworth/kong_Assets_hybridWoolworth_Take-4.1k.mov
>>>/vol/tempwrangler/andrew/hannah1/
>>>cp
>>>/vol/shotsub/Movies/kong/Assets/queensboroBridge/kong_Assets_queensboroBridge_Take-3.1k.mov
>>>/vol/tempwrangler/andrew/hannah1/
>>>cp
>>>/vol/shotsub/Movies/kong/Assets/williamsburgBridge/kong_Assets_williamsburgBridge_Take-2.1k.mov
>>>/vol/tempwrangler/andrew/hannah1/
>>>cp
>>>/vol/shotsub/Movies/kong/Assets/brooklynBridge/kong_Assets_brooklynBridge_Take-2.1k.mov
>>>/vol/tempwrangler/andrew/hannah1/
>>>
>>>
>>>My question is... how to get a different output, ie putting the numbers
>>>from the list into the destination filename:
>>>cp
>>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>>/vol/tempwrangler/andrew/hannah1/kong_Assets_hybrid_Take-28.1k.263341.mov
>>>
>>>all Using a single line command
>>>
>>>from the answer i can probably work out how to make it:
>>>cp
>>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>>/vol/tempwrangler/andrew/hannah1/kong_Assets_hybrid_Take-28.1k.263341_bldg_whitehallBuildingAnnex.mov
>>>
>>>note, i already have a script that does all of this, Im just reasonably
>>>new to awk and i was wondering what i needed to add to the command to
>>>get what i want
>>>
>>>in fact im new to linux all together, so most commands i dont actually
>>>know about

>>
>>
>> How about:
>>
>> while read item num
>> do
>> mv
>> /vol/shotsub/Movies/kong/Assets/williamsburgBridge/kong_Assets_$item-*
>> /vol/tempwrangler/andrew/hannah1/
>> done <list
>>
>> Or something like that.
>> It really is simple, so you should keep it simple.
>>

> Im unable to do this as i need to use the script -
> alambert/scripts/uid2mov.pl with the 6 digit number in order to resolve
> the location of the .mov file
>
> So essentially first i need to run uid2mov.pl <number> to get the
> /vol/shotsub/Movies/kong/Asse.... etc and i then need to attach that
> same number and posisbly its description from the original list


You need to use your brains.

Try something like this:

while read item num
do
file=`uid2mov.pl $num`
mv $file /vol/tempwrangler/andrew/hannah1/$file-$num
done <list

I suggest you try "man bash" and read very carefully.
Also, look in /usr/share/doc/bash-N.NN/scripts etc where you will
find lots of examples.

 
Reply With Quote
 
Andrew
Guest
Posts: n/a
 
      09-11-2005
Harry wrote:
> Andrew wrote:
>
>
>>Harry wrote:
>>
>>>Andrew wrote:
>>>
>>>
>>>
>>>>Im sure this is possible, Im just not sure how to do it
>>>>
>>>>i have a text file called "list"
>>>>
>>>>it contains:
>>>>bldg_whitehallBuildingAnnex 263341
>>>>bldg_woolworth 262737
>>>>Queensboro 248950
>>>>Williamsburg 248948
>>>>Brooklyn 255674
>>>>
>>>>i also have a script called uid2mov.pl which uses the numbers in the
>>>>above list to get a directory location relative to the number
>>>>
>>>>Ive used this command on the list:
>>>>cat list | awk '{system (" ~alambert/scripts/uid2mov.pl " $2)}' | awk
>>>>'{system ("cp " $1" /vol/tempwrangler/andrew/hannah1/")}'
>>>
>>>
>>>That is crazy!
>>>You should just use:
>>>
>>> while read dir num
>>> do
>>> mv $dir /vol/tempwrangler/andrew/hannah1/
>>> done <list
>>>
>>>
>>>
>>>>which executes:
>>>>cp
>>>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>>>/vol/tempwrangler/andrew/hannah1/
>>>>cp
>>>>/vol/shotsub/Movies/kong/Assets/hybridWoolworth/kong_Assets_hybridWoolworth_Take-4.1k.mov
>>>>/vol/tempwrangler/andrew/hannah1/
>>>>cp
>>>>/vol/shotsub/Movies/kong/Assets/queensboroBridge/kong_Assets_queensboroBridge_Take-3.1k.mov
>>>>/vol/tempwrangler/andrew/hannah1/
>>>>cp
>>>>/vol/shotsub/Movies/kong/Assets/williamsburgBridge/kong_Assets_williamsburgBridge_Take-2.1k.mov
>>>>/vol/tempwrangler/andrew/hannah1/
>>>>cp
>>>>/vol/shotsub/Movies/kong/Assets/brooklynBridge/kong_Assets_brooklynBridge_Take-2.1k.mov
>>>>/vol/tempwrangler/andrew/hannah1/
>>>>
>>>>
>>>>My question is... how to get a different output, ie putting the numbers
>>>
>>>>from the list into the destination filename:
>>>
>>>>cp
>>>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>>>/vol/tempwrangler/andrew/hannah1/kong_Assets_hybrid_Take-28.1k.263341.mov
>>>>
>>>>all Using a single line command
>>>>
>>>
>>>>from the answer i can probably work out how to make it:
>>>
>>>>cp
>>>>/vol/shotsub/Movies/kong/Assets/hybrid/kong_Assets_hybrid_Take-28.1k.mov
>>>>/vol/tempwrangler/andrew/hannah1/kong_Assets_hybrid_Take-28.1k.263341_bldg_whitehallBuildingAnnex.mov
>>>>
>>>>note, i already have a script that does all of this, Im just reasonably
>>>>new to awk and i was wondering what i needed to add to the command to
>>>>get what i want
>>>>
>>>>in fact im new to linux all together, so most commands i dont actually
>>>>know about
>>>
>>>
>>>How about:
>>>
>>> while read item num
>>> do
>>> mv
>>> /vol/shotsub/Movies/kong/Assets/williamsburgBridge/kong_Assets_$item-*
>>> /vol/tempwrangler/andrew/hannah1/
>>> done <list
>>>
>>>Or something like that.
>>>It really is simple, so you should keep it simple.
>>>

>>
>>Im unable to do this as i need to use the script -
>>alambert/scripts/uid2mov.pl with the 6 digit number in order to resolve
>>the location of the .mov file
>>
>>So essentially first i need to run uid2mov.pl <number> to get the
>>/vol/shotsub/Movies/kong/Asse.... etc and i then need to attach that
>>same number and posisbly its description from the original list

>
>
> You need to use your brains.
>
> Try something like this:
>
> while read item num
> do
> file=`uid2mov.pl $num`
> mv $file /vol/tempwrangler/andrew/hannah1/$file-$num
> done <list
>
> I suggest you try "man bash" and read very carefully.
> Also, look in /usr/share/doc/bash-N.NN/scripts etc where you will
> find lots of examples.
>

Im unsure if you have actually read what i asked.. and also mentioned in
other posts, but im looking for a one line solution. i already have a
working perl script that does exactly what i want to do.. In fact i dont
need to do this particular job anymore as its done

Im just curious about awk and a single command line solution, or maybe
not even awk, There could be some other smart linux command that can
help me achieve what im after
 
Reply With Quote
 
H.O.G
Guest
Posts: n/a
 
      09-11-2005
On Sun, 11 Sep 2005 13:47:28 +1200, daemon9 <> spoke
these fine words:
>>>
>>>>> What's that, stalker?
>>>>>
>>>>> Bit hot under the collar, there, turniphead?
>>>>
>>>> It appears you are, go have a lie down before you make a dick of yourself
>>>> *again*
>>>
>>>He sure does.
>>>
>>>> Before you rush off though, why do you call misfit a convict, yet tell
>>>> Michael George that you yourself have smoked pot and feel its a victemless
>>>> crime?
>>>> Are you that low?
>>>
>>>Yes he is. You need to understand the psychology of damaged people like
>>>him:
>>>
>>>He's basically an insecure spotty little reject. He is trying to build his
>>>self esteem up by harassing and putting others down. He even INVENTS
>>>complaints in order to do so.
>>>
>>>He might be tolerated if he actually KNEW what he was talking about. But I
>>>doubt he'd be tolerated even then.
>>>
>>>Woger has the excuse of being senile. Poor excuse that it is, he is at
>>>least useful once or twice a year (even a busted watch is right twice a
>>>day).
>>>
>>>HOG does not have these excuses. He is either deliberately an arrogant,
>>>ignorant little ****tard hypocrite or he has run out of his Ritalin.
>>>
>>>Either way, ignore him.

>>
>> LOL! Thanks for the comedy, knobby.
>>
>> I only "put down" people who abuse me first.

>
>So why arn't you fighting back you a spineless wuss?
>
>d9


Because, unlike morons like Shane and Brendan, I don't think nz.comp
is the appropriate place for flame wars.

And Brendan's post is just too pathetic to even bother wasting my time
on.
 
Reply With Quote
 
Shane
Guest
Posts: n/a
 
      09-11-2005
On Sun, 11 Sep 2005 16:46:12 +1200, H.O.G wrote:

> Because, unlike morons like Shane and Brendan, I don't think nz.comp is
> the appropriate place for flame wars.


Well that explains this post

http://groups.google.co.nz/groups?as...=2005&safe=off
http://tinyurl.com/cv2j6
--
Hardware, n.: The parts of a computer system that can be kicked

The best way to get the right answer on usenet is to post the wrong one.

 
Reply With Quote
 
H.O.G
Guest
Posts: n/a
 
      09-11-2005
On Sun, 11 Sep 2005 16:59:42 +1200, Shane <>
spoke these fine words:

>On Sun, 11 Sep 2005 16:46:12 +1200, H.O.G wrote:
>
>> Because, unlike morons like Shane and Brendan, I don't think nz.comp is
>> the appropriate place for flame wars.

>
>Well that explains this post
>
>http://groups.google.co.nz/groups?as...=2005&safe=off
>http://tinyurl.com/cv2j6


Hi, Stalker. That was a comment, not a flamewar.

Buy a dictionary, turniphead.
 
Reply With Quote
 
Shane
Guest
Posts: n/a
 
      09-11-2005
On Sun, 11 Sep 2005 17:56:07 +1200, H.O.G wrote:

> On Sun, 11 Sep 2005 16:59:42 +1200, Shane <>
> spoke these fine words:
>
>>On Sun, 11 Sep 2005 16:46:12 +1200, H.O.G wrote:
>>
>>> Because, unlike morons like Shane and Brendan, I don't think nz.comp is
>>> the appropriate place for flame wars.

>>
>>Well that explains this post
>>
>>http://groups.google.co.nz/groups?as...=2005&safe=off
>>http://tinyurl.com/cv2j6

>
> Hi, Stalker. That was a comment, not a flamewar.
>
> Buy a dictionary, turniphead.


http://en.wikipedia.org/wiki/Flaming
--
Hardware, n.: The parts of a computer system that can be kicked

The best way to get the right answer on usenet is to post the wrong one.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if you guys go non-hybrid blu-ray or hd-dvd.... you guys may be looking at laserdisc/sacd type sales. Doc Martian DVD Video 2 03-23-2006 06:01 PM
Hey guys...take a look at what these guys are doing... christo@studiochristopher.com Digital Photography 1 12-23-2004 12:40 AM
Re: One more Pretty Face - Pretty face9.jpg [1/1] Harvey Digital Photography 7 11-04-2004 09:53 AM
Re: Pretty Please Peer2Peer need help Pretty Please John Haithwaite @ Blue Case Solutions Computer Support 0 07-06-2003 10:20 PM
Re: Pretty Please Peer2Peer need help Pretty Please Ralph Wade Phillips Computer Support 0 07-06-2003 09:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57