Sponsored Content
Top Forums Shell Programming and Scripting Bash: Reading out rows of a file into a dynamic array and check first literal Post 302339875 by ABE2202 on Friday 31st of July 2009 03:33:16 PM
Old 07-31-2009
I want to read out ALL appearances of the string 'Movie' and check whether they ALL beginn with a '*'. So I think I need an array with a DYNAMIC number of fields since they number of 'Movie'-string varies.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is there any commands to check the dynamic changes of a file

Hi guys i had a script which will generate a log file.Is there any commands to check the dynamic changes in the log file,i.e if i open the log file i should able to see the updating changes live...I hope u understand my query... (2 Replies)
Discussion started by: vinoo
2 Replies

2. Programming

Creating an array to hold posix thread ids: Only dynamic array works

I am facing a strange error while creating posix threads: Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output. Snippet 1 This works: -------------- int *threadids; threadids = (int *) malloc (num_threads * sizeof(int)); ... (4 Replies)
Discussion started by: kmehta
4 Replies

3. UNIX for Dummies Questions & Answers

Reading a file into an array

I have a file that is a text file, how to get all the words into and array, i am able to get each line but not each word :(. Here is what i searched and already found...https://www.unix.com/shell-programming-scripting/99207-pipe-text-file-into-array.html. This one reads a whole line into... (6 Replies)
Discussion started by: SasankaBITS
6 Replies

4. Shell Programming and Scripting

Reading from a file and assigning to an array in perl

I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value. I was thinking the best way to... (1 Reply)
Discussion started by: billprice13
1 Replies

5. Shell Programming and Scripting

reading data from a file to an array

I need some help with this code below, i doesnt know why it will run twice with my function, but my function only got if else, any other way that can read line and put into array? while read line; do read -A array <<<$line n=${#array} for ((i=1;i<$n;i++)); do print... (1 Reply)
Discussion started by: gavin_L
1 Replies

6. Shell Programming and Scripting

Reading a file into array

Hi, I need to read a file into array and print them in a loop:- 1st file :-cat a.txt RC1 RC2 RC3 RC4 My Program:- #!/bin/ksh index=0 while do read cnt<a.txt print "cnt value is ${cnt} index=`expr $index + 1` done Code tags for code, please. (5 Replies)
Discussion started by: satishmallidi
5 Replies

7. Shell Programming and Scripting

Reading a file into an array

Hi I have a file with contents as below : server | ABC Issue : File System Missing XYZ Issue : Wrong Syntax PQR Issue : Old File to be removed Now I am looking for an o/p similar to server <tab> ABC Issue : File System Missing <tab> XYZ Issue : Wrong Syntax <tab>... (4 Replies)
Discussion started by: deo_kaustubh
4 Replies

8. Shell Programming and Scripting

Help w/ Reading Matrix & Storing in dynamic array

First of I would just like to state that I am not looking for you guys to just do my work for me, I do want to learn and actually understand everything that is happening. Hey all, I am having trouble on this. What I need to do is... Write an executable C file that will take a text file (not a... (8 Replies)
Discussion started by: innvert
8 Replies

9. Shell Programming and Scripting

Reading a long literal continued next line

I am trying to identify all messages or prompts from a number of COBOL programs and they can usually be identified by a pair of double quotes on one line. However, sometimes the literal will not be finished on the first line but after a dash in column 7 of the next line, the literal will be... (6 Replies)
Discussion started by: wbport
6 Replies

10. UNIX for Dummies Questions & Answers

Check for empty line at end of a dynamic header in each file

Hi Folks, I have a requirement to develop a shell script. PFB my requirement, Requirement: I need to check an empty line after the end of each header in respective file and if a empty line is present simply echo file OK and if empty line is not present echo "Adding empty line" and add an... (6 Replies)
Discussion started by: tpk
6 Replies
.::SWF::DisplayItem(3pm)				User Contributed Perl Documentation				  .::SWF::DisplayItem(3pm)

NAME
SWF::DisplayItem - SWF DisplayItem class SYNOPSIS
use SWF::DisplayItem; $dispitem = $movie->add($shape); $dispitem->rotate(45); DESCRIPTION
When you place an SWF object (one of the types that can be seen with eyes by user) in a frame of a SWF::Movie or SWF::MovieClip, the return value will be in a SWF::DisplayItem. You can now modify that item in current and every following frames of the clip where you added the SWF object. Further it is accessible by ActionScript too. Just give the DisplayItem a name with method setName($name) after you added the SWF object to a SWF::Movie or SWF::MovieClip METHODS
$displayItem->moveTo($x, $y); Move $displayItem to ($x, $y) in global co-ordinates. $displayItem->move($x, $y); Displace $displayItem by ($x, $y) $displayItem->scaleTo($x [,$y]); Set $displayItem scale to $x in the x-direction and $y in the y-direction. If $y is not specified, $y=$x is assumed. $displayItem->scale($x [,$y]); Multiply $displayItem scale by $x in the x-direction and $y in the y-direction. If $y is not specified, $y=$x is assumed. $displayItem->rotateTo($degrees); Set $displayItem rotation to $degrees. $displayItem->rotate($degrees); Rotate $displayItem by $degrees. $displayItem->skewX($x); Add $x to the current x-skew. $displayItem->skewXTo($x); Set x-skew to $x. 1.0 is 45-degree forward slant. More is more forward while less is more backward. $displayItem->skewY($y); Add $y to the current y-skew. $displayItem->skewYTo($y); Set y-skew to $y. 1.0 is 45-degree upward slant. More is more upward while less is more downward. $displayItem->setMatrix($a, $b, $c, $d, $e, $f) Do an operation of rotating/skewing (b,c), moving (e,f) and scaling (a,d) at once. The default initial values of an SWF::DisplayItem object's matrix are 1.0, 0, 0, 1.0, 0, 0 . So calling setMatrix with these defaults (setMatrix(1.0, 0, 0, 1.0, 0, 0);) will reset results of earlier calls of SWF::DisplayItem methods (like rotate(45) etc. etc.) $displayItem->setDepth($depth); Set Z-order of $displayItem to $depth. $displayItem->setRatio($ratio); Useful for SWF::Morph. Sets $displayItem ratio to $ratio. $displayItem->setColorAdd($r, $g, $b [,$a])) $displayItem->addColor($r, $g, $b [,$a]); Add RGB color to the $displayItem's color transform. Default value of $a is 1.0 $displayItem->setColorMult($r, $g, $b [,$a])) $displayItem->multColor($r, $g, $b [,$a]); Multiplies the $displayItem's color transform by the given values. Default value of $a is 1.0 $displayItem->setName($name); Set $displayItem's name to $name (used for targetting with SWF::Action). $displayItem->remove(); Remove $displayItem from the movie display list. ($x, $y) = $displayItem->getPosition((); Returns displace coordinates of $displayitem. $degrees = $displayItem->getRotation(); Returns rotation of $displayItem. ($x, $y) = $displayItem->getScale(); Returns scale of $displayItem in x- and y-direction. ($x, $y) = $displayItem->getSkew(); Returns x- and y-skew of $displayItem. $depth = $displayItem->getDepth(); Returns Z-order of $displayItem. $displayItem->setMask($level); Sets a mask level: display items with lower or equal depth are masked, any other display items are not masked. Use setDepth() to control desired masking. $displayItem->endMask() End masking started by prior setMask() call. $displayItem->addAction( $action, $flags ) Add $action, an object of SWF::Action class. The flags are exported from SWF::Constants. SWFACTION_ONLOAD SWFACTION_ENTERFRAME SWFACTION_UNLOAD SWFACTION_MOUSEMOVE SWFACTION_MOUSEDOWN SWFACTION_MOUSEUP SWFACTION_KEYDOWN SWFACTION_KEYUP SWFACTION_DATA Using this flags you have control at which events the action will run. $displayItem->setBlendMode($mode) Set an alternative blend mode instead of default alpha blend. Possible modes are: SWFBLEND_MODE_NULL SWFBLEND_MODE_NORMAL SWFBLEND_MODE_LAYER SWFBLEND_MODE_MULT SWFBLEND_MODE_SCREEN SWFBLEND_MODE_DARKEN SWFBLEND_MODE_LIGHTEN SWFBLEND_MODE_ADD SWFBLEND_MODE_SUB SWFBLEND_MODE_DIFF SWFBLEND_MODE_INV SWFBLEND_MODE_ALPHA SWFBLEND_MODE_ERASE SWFBLEND_MODE_OVERLAY SWFBLEND_MODE_HARDLIGHT Here comes some demonstration code: use SWF::Constants qw(:DisplayItem); # .... $sh=new SWF::Shape(); $fill = $sh->addFill(255, 0, 0, 255); # red $sh->setRightFill($fill); $sh->drawLine(440, 0); $sh->drawLine(0, 380); $sh->drawLine(-440, 0); $sh->drawLine(0, -380); # $sh2=new SWF::Shape(); $fill2 = $sh2->addFill(0, 255, 0, 255); # green $sh2->setRightFill($fill2); $sh2->drawLine(240, 0); $sh2->drawLine(0, 280); $sh2->drawLine(-240, 0); $sh2->drawLine(0, -280); $di=$m->add($sh); $di2=$m->add($sh2); # $di2->setBlendMode( SWFBLEND_MODE_NORMAL); # would be green ( as you have expected ) $di2->setBlendMode( SWFBLEND_MODE_ADD); # y e l l o w ( surprising, a litle bit ) $displayItem->cacheAsBitmap($flag) Set a flag (value 0 or 1) showing the character can be cached as a bitmap. This might improve rendering speed, if the object does no change often. This feature is available for SWF version >= 8 only. $displayItem->flush() Writes the SWF::DisplayItem object immediately to the blocklist. Usually MING waits with writing a display item until a frame is closed through a nextFrame() call, because a display items state could be altered for the current frame. By using the flush() method MING does not wait and writes the frame immediately. Therefore an user can influence the swf tag order. Changing a display items state after calling flush() takes effect in the next frame. $matrix = $displayItem->getMatrix() Returns an associated SWF::Matrix object. $character = $displayItem->getCharacter() Returns the associated SWF::Character object. $displayItem->addFilter( $filter ) Process the DisplayItem object thru a prepared filter: an object of SWF::Filter class, e.g. BlurFilter or DropShadowFilter. Filters are available since player version 8. $displayItem->setCXform( $cxform ) Process the DisplayItem object thru $cxform: a prepared color transformation object of SWF::CXform class. AUTHOR
Soheil Seyfaie (soheil AT users.sourceforge.net) Peter Liscovius Albrecht Kleine SEE ALSO
SWF, SWF::Button, SWF::Movie, SWF::MovieClip, SWF::Shape, SWF::Text, SWF::TextField, SWF::Filter, SWF::CXform, SWF::Matrix, SWF::Action, SWF::Morph, SWF::Character, SWF::Constants perl v5.14.2 2011-10-26 .::SWF::DisplayItem(3pm)
All times are GMT -4. The time now is 02:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy