Sponsored Content
Top Forums Shell Programming and Scripting Get specific information from output Post 303043105 by Lord Spectre on Saturday 18th of January 2020 07:27:07 AM
Old 01-18-2020
Thank you very much Peasant, it's working fine and this is the good start point for the rest of my code!

Thank you
Lucas
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to perform Grep on many Gzip files, Searching for Specific information

Hello, I am wondering if you can assist with my question and ask kindly for this. I have a number of files that are listed as file1.gz through file100.gz. I am trying to perform a grep on the files and find a specific date that only resides within within one of the files. There are... (3 Replies)
Discussion started by: legharb
3 Replies

2. UNIX for Advanced & Expert Users

using txr to extract information from output

am using txr command (txr 1097) on a process that generates the following output. Im trying to extract the 13th field from the highlighted string. it is delimited by '?'. The 13th field corresponds to the '0' (in bold). can you let me know how I can extract the 13 th field please? ... (1 Reply)
Discussion started by: pazman
1 Replies

3. Shell Programming and Scripting

Using txr to extract information from output

am using txr command (txr 1097) on a process that generates the following output. Im trying to extract the 13th field from the highlighted string. it is delimited by '?'. The 13th field corresponds to the '0' (in bold). can you let me know how I can extract the 13 th field please? ... (1 Reply)
Discussion started by: pazman
1 Replies

4. UNIX and Linux Applications

Reflection Macro: Use Current Date Information in specific field of report

Hi Everyone, New to the forum, and have my first question. I have the following Macro currently being used within Telnet to run a report for the date being entered. However, now I need the Macro to input the day after today to the the day after today. Example: If today is May 9, 2012 - the... (0 Replies)
Discussion started by: CipherEffect
0 Replies

5. Shell Programming and Scripting

get specific information from text file or command output

Hello, I would need some help, :wall: on a linux script, I am not sure how can I separate some text file, Text file contains something similar to this: share "userhome_e" "/fs1_100g/FILE58/userhome" umask=022 maxusr=4294967295 netbios=FILE58 share "bu share"... (3 Replies)
Discussion started by: nakaedu
3 Replies

6. Shell Programming and Scripting

[Solved] How can I pull specific information from PS?

I need to grab information from the output of the ps command. For each line of ps output that contains _progres -b I need to get the word that follows -p. The "-p" can be anywhere after "_progres -b". Using grep to select the correct lines is no problem (e.g. ps -ef|grep "_progres \-b|grep -v... (3 Replies)
Discussion started by: Papa Lee
3 Replies

7. Shell Programming and Scripting

Pull out information from output logs

My scenario is as follows. 1. I have a reference file with the IP addresses and names $ cat ref.list 10.11.xxx.xxx AA 10.12.xxx.xxx BB 10.13.xxx.xxx CC 10.14.xxx.xxx DD 2. A script runs and gets me one of the IP addresses and puts it in a separate file, for e.g... (2 Replies)
Discussion started by: Nagesh_1985
2 Replies

8. Shell Programming and Scripting

How to extract specific information?

hi, i have a file A like this: ******************* No 2823 ******************** contig15205- G383C4U02H4G80+ is in contig15205- G383C4U02HGLXM- is in contig15205- G383C4U01C3HIZ+ is in contig15205- ... (3 Replies)
Discussion started by: the_simpsons
3 Replies

9. Shell Programming and Scripting

Extract Specific Information from a particular field

Hi, I am trying to extract a specific information from a file which contains more than 200 million records. Attached the input file for your reference. My file contains information below ... (4 Replies)
Discussion started by: rramkrishnas
4 Replies

10. Shell Programming and Scripting

Missing information in output file

Gents, Using the following code i am able to output the information i need, but some of the strings are not complete due to the separator : used.. Kindly can u help me to get all string after the first : Example in the output file column 16 i should get 17/11/25 03:43:51:732000 but i... (8 Replies)
Discussion started by: jiam912
8 Replies
Twiddle(3pm)						User Contributed Perl Documentation					      Twiddle(3pm)

NAME
Term::Twiddle - Twiddles a thingy while-u-wait SYNOPSIS
use Term::Twiddle; my $spinner = new Term::Twiddle; $spinner->start; system('tar', '-xvf', 'some_phat_tarfile.tar'); $spinner->stop; $spinner->random; ## makes it appear to really struggle at times! $spinner->start; &some_long_function(); $spinner->stop; DESCRIPTION
Always fascinated by the spinner during FreeBSD's loader bootstrap, I wanted to capture it so I could view it any time I wanted to--and I wanted to make other people find that same joy I did. Now, anytime you or your users have to wait for something to finish, instead of twiddling their thumbs, they can watch the computer twiddle its thumbs. During Twiddling Once the twiddler/spinner is in motion you need to do something (e.g., unpack a tar file, call some long function, etc.). You can do almost anything in between start and stop as long as there are no sleep calls in there (unless the process has been forked, as in a Perl system call). From Time::HiRes: Use of interval timers may interfere with alarm(), sleep(), and usleep(). In standard-speak the "interaction is unspecified", which means that anything may happen: it may work, it may not. Try not to do any terminal I/O while the twiddler is going (unless you don't mind dragging the twiddler around with your cursor). Spinner Methods new Creates a new Twiddle object: my $spinner = new Term::Twiddle; Optionally initializes the Twiddle object: ## a moderately paced spinner my $spinner = new Term::Twiddle( { rate => 0.075 } ); start Starts the twiddler twiddling: $spinner->start; stop Stops the twiddler: $spinner->stop; thingy Creates a new thingy. The argument is a reference to a list of strings to print (usually single characters) so that animation looks good. The default spinner sequence looks like this: $spinner->thingy( [ "\", "|", "/", "-" ] ); an arrow could be done like this: $spinner->thingy( [ "---->", " ----->", " ----->", " ----->", " ----->|", " ---->|", " --->|", " -->|", " ->|", " >|", " |", " "]); Look at the test.pl file for this package for more fun thingy ideas. rate Changes the rate at which the thingy is changing (e.g., spinner is spinning). This is the time to wait between thingy characters (or "frames") in seconds. Fractions of seconds are supported. The default rate is 0.175 seconds. $spinner->rate(0.075); ## faster! probability Determines how likely it is for each step in the thingy's motion to change rate of change. That is, each time the thingy advances in its sequence, a random number from 1 to 100 is generated. If probability is set, it is compared to the random number. If the probability is greater than or equal to the randomly generated number, then a new rate of change is randomly computed (between 0 and 0.2 seconds). In short, if you want the thingy to change rates often, set probability high. Otherwise set it low. If you don't want the rate to change ever, set it to 0 (zero). 0 is the default. ## half of all sequence changes will result in a new rate of change $spinner->probability(50); $spinner->start; do_something; $spinner->stop; The purpose of this is to create a random rate of change for the thingy, giving the impression that whatever the user is waiting for is certainly doing a lot of work (e.g., as the rate slows, the computer is working harder, as the rate increases, the computer is working very fast. Either way your computer looks good!). random Invokes the probability method with the argument specified. If no argument is specified, 25 is the default value. This is meant as a short-cut for the probability method. $spinner->random; stream Select an alternate stream to print on. By default, STDOUT is printed to. $spinner->stream(*STDERR); Alternative Spinner Methods Since version 2.70, Term::Twiddle objects support a couple of new spinners that aren't so "plain". 2.70 includes a bounceing ball and a swishing object (that's the best name I could think to call it). The following methods are used to activate and customize these new spinners. type Use this method to set the type of spinner. The default type (no type) is whatever thingy is set to. Two other currently supported types are bounce, and swish. These may be set in the constructor: my $sp = new Term::Twiddle({ type => 'bounce' }); $sp->start; or you can set it with this type method: my $sp = new Term::Twiddle; $sp->type('bounce'); There is currently no way to add new types without some hacking (it's on the "to do" list). width This method is only used when type is undefined (i.e., a normal spinner). width determines how wide the bounce or swish objects go. width may be set in the constructor: my $sp = new Term::Twiddle({ type => 'bounce', width => 60 }); $sp->start; or you can set it with this width method: my $sp = new Term::Twiddle({ type => 'swish' }); $sp->width(74); delay Determines the speed of motion of the object. Usually the default is fine (and each object has its own default delay option for optimal aesthetics). EXAMPLES
Show the user something while we unpack the archive: my $sp = new Term::Twiddle; $sp->random; $sp->start; system('tar', '-zxf', '/some/tarfile.tar.gz'); $sp->stop; Show the user a bouncing ball while we modify their configuration file: my $sp = new Term::Twiddle( { type => 'bounce' } ); $sp->start; ## there must not be any 'sleep' calls in this! do_config_stuff(); $sp->stop; AUTHOR
Scott Wiersdorf, <scott@perlcode.org> CAVEATS
o Prolly won't run on platforms lacking setitimer. Will run on Cygwin/Win32 (reported by Zak Zebrowski--thanks!). o ACKNOWLEDGEMENTS
o Thanks to Tom Christiansen for the timer code (found lurking in an old FAQ somewhere). He probably never had an idea that it would be part of one of the most useful modules on CPAN ;o) The timer code has since been replaced by Time::HiRes's setitimer function, but it is good to thank Mr. Christiansen for his goodness to Perl anyway. o "Drew" (drew@drewtaylor.com) from rt.cpan.org for suggesting the removal of 'use warnings' for the faithful 5.005 users. o Orignal swishing motion filched from Term::ReadKey's test.pl by Kenneth Albanowski (kjahds@kjahds.com). Danke! SEE ALSO
perl. perl v5.10.1 2010-08-08 Twiddle(3pm)
All times are GMT -4. The time now is 01:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy