RegExp to capture numbers

Hello

I have lines that contain numbers that looks like this: \s\s\s1025.205\s\s\s-0.002\s\s\s520.125\s\s\s0.001\s\s\s\s

number of \s to separate is not constant

What expression can I use to get a number between "\s".

Concerning

Tinnitus

This one works I'm sorry that I have not noticed that.

Tags: NI Software

Similar Questions

  • most effective way to retrieve the channel number

    Hello guys,.

    I use this Regexp to extract numbers in a string, and I doubt that there is a more effective way to achieve this:
     SELECT  regexp_replace (regexp_replace ( REGEXp_REPLACE ('  !@#$%^&*()_+= '' + 00 SDFKA 324 000 8702 234 |  " ' , '[[:punct:]]',''), '[[:space:]]',''), '[[:alpha:]]','')  FROM dual
    {code}
    
    Is there a more efficient way to get this done ?
    
    Regards,
    Fateh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Hello

    Using regular expressions, you can remove everything that is not a number by saying:

    REGEXP_REPLACE ( str
                , '[^[:digit]]'
                )     
    

    When ^ is the first character inside the brackets, it means "everything except the following.

  • RegExp with padding for the numbers

    Hi all

    I have a column VARCHAR2 representing Article and paragraph of a document and I need to sort in a sophisticated this column method.

    The problem is that because this value is from a form using free text, the format is quite heterogeneous. Then we would have something like:

    select '1' as section from dual union all
    select '7(1), 8(3)' as section from dual union all
    select '9(2)(b)' as section from dual union all
    select '11(1)(c)' as section from dual union all
    select 'Annex VI' as section from dual;
    

    the problem is that if we use the lexicographical order, that we'd end up with 11 front of 9.2 b (1)

    select  section from (
    select '1' as section from dual union all
    select '7(1), 8(3)' as section from dual union all
    select '9(2)(b)' as section from dual union all
    select '11(1)(c)' as section from dual union all
    select 'Annex VI' as section from dual)
    order by 1;
    
    SECTION
    ----------
    1        
    11(1)(c) 
    7(1), 8(3)
    9(2)(b)  
    Annex VI 
    

    It is true that articles go not beyond say 1000 thought I replace all the groups of digits of 0 left padded values. An expression that I would get the right result

    select  section from (
    select '001' as section from dual union all
    select '007(001), 008(003)' as section from dual union all
    select '009(002)(b)' as section from dual union all
    select '011(01)(c)' as section from dual union all
    select 'Annex VI' as section from dual)
    order by 1;
    

    SECTION

    ------------------

    001

    007 (001), 008 (003)

    009 (002) (b)
    011 (01) (c)
    Annex VI

    This can be achieved with regexp?, the thing is I can locate the numbers and normally the depth of numbers would be only 2 directions 1 (2) and no 1 (2) (3) so with 2 nested regexp_replace could be good. The thing is that I don't realize to fill in the 3rd parameter:

    Best regards

    Hello

    Using REGEXP_REPLACE to fill in the numbers:

    SELECT section

    , REGEXP_REPLACE (REGEXP_REPLACE (section - for debugging only

    , '(\d+)'

    , "000\1".

    )

    , « 0+(\d{4}) »

    , '\1'

    ) AS sort_str

    ARTICLE

    ORDER OF REGEXP_REPLACE (REGEXP_REPLACE (section

    , '(\d+)'

    , "000\1".

    )

    , « 0+(\d{4}) »

    , '\1'

    )

    ;

    The inner REGEXP_REPLACE adds 3 major 0 ' to all numbers, so that all the numbers are at least 4 digits.

    Removes from the external REGEXP_REPLACE 0 ' to all numbers, so that all numbers are exactly 4 digits.

    In Production, you will not want to repeat the expression in the SELECT clause. I just did here to help us see what's going on.

    Output:

    SECTION SORT_STR

    ---------- ------------------------------

    1 0001

    7 (1), 8 (3) 0007 (0001) 0008 (0003)

    9 2 b 0009 (0002) (b)

    11.1 c 0011 (0001) (c)

    Annex VI to annex VI

  • The numbers in a search: separation comma with regexp

    I have a problem where in I need to search for perticular number into a string.
    for example

    Row1 - 33,15, 02, 6
    row2 - 03,4, 77
    row3 - 3,66,88

    Now, I need to find the number 3 in the table above.
    Result must be row2 and line 2. Because the number 3 is row2, and row3. I don't want first row to return under its 33 not 3.

    Is there a solution for this.

    Thank you

    Welcome to the forum!

    WHERE  REGEXP_LIKE ( ',' || str || ','
                        , ',0*3,'
                 )
    

    There are '3' in str, preceded by a number any of '0', when that's all there is between the delimiters. In other words, will match '3', '03,' and '000003', but not '33' or ' 303.

    He'll find no other channels that are numerically equivalent to 3, for example ' 3. «, ' 3,00', '3E0', ' 1 + 2' or ' SQRT (9) ".» To do this, you will need to divide str into its parts separated by commas, and then use a function like TO_NUMBER.

  • Automatically insert a slash (/) after that I entered the numbers

    I would like to add a slash (/) when entering the numbers. My query looks like that found in this thread:

    http://forums.Adobe.com/message/5120770#5120770

    The field is to capture the blood pressure, that's why it can be 999/999, 999/99 or 99/99. If you use arbitrary mask is not possible because it will depend on if the blood pressure is over 99 or not.

    Because now I'm using the following in the custom format, but it does not add the slash by itself, and the user must always enter.

    Custom validation script

    (function () {}

    Do nothing if the field is empty

    If (! event.value) return;

    Fill in the other fields if the length of the string is correct

    If (event.value.length = 7)

    {event.value = util.printx ("999/999", event.value) ;}}

    on the other

    If (event.value.length = 6)

    {event.value = util.printx ("999/99", event.value) ;}}

    on the other

    If (event.value.length = 5)

    {event.value = util.printx ("99/99", event.value) ;}}

    })();

    I kinda want to operate if the field was the arbitrary mask, so if the user enter 6 digits it becomes 999/999; 5 digits = 999/99; and 4 digits = 99/99.

    The Regular Expression object is used to deal with this kind of problem. Because of multiple entries, you may need more than one reg exp for test and you should use a custom key sequence, custom format and the validation script and

    Here is the custom scripts.

    custom script hits

    (function() {}

    If (event.willCommit == false) {}

    [var RE_BP_KS = / ^ \d{0,3}[./]? \d{0,3}$/;

    If ((event.value + event.change) RE_BP_KS.test is false)

    Event.RC = false;

    } / / end of custom script typo

    } ) ();

    custom script hit end

    custom script marker

    (function() {}

    If (event.value! = "") {}

    var RE_BP6_Frmt = /^(\d{3})[./]?) (\d{3})$/; Enter 999/999;

    var RE_BP5_Frmt = /^(\d{3})[./]?) (\d{2})$/; Enter 999/99;

    var RE_BP4_Frmt = /^(\d{2})[./]?) (\d{2})$/; 99/99 entry;

    {if (RE_BP6_Frmt.test (Event.value))}

    Event.Value = RegExp. $1 + ' / ' + RegExp. $2;

    } else {if (RE_BP5_Frmt.test (event.value))

    Event.Value = RegExp. $1 + ' / ' + RegExp. $2;

    } else {if (RE_BP4_Frmt.test (event.value))

    Event.Value = RegExp. $1 + ' / ' + RegExp. $2;

    } / / end new test

    } / / end of custom format script

    } ) ();

    custom validation script

    (function () {}

    If (event.value! = "") {}

    var RE_BP6_Frmt = /^(\d{3})[./]?) (\d{3})$/; Enter 999/999;

    var RE_BP5_Frmt = /^(\d{3})[./]?) (\d{2})$/; Enter 999/99;

    var RE_BP4_Frmt = /^(\d{2})[./]?) (\d{2})$/; 99/99 entry;

    If (RE_BP6_Frmt.test (Event.value)) event.rc = true;

    else if (RE_BP5_Frmt.test (event.value)) event.rc = true;

    else if (RE_BP4_Frmt.test (event.value)) event.rc = true;

    else {}

    App.Alert ("incomplete heading", 1, 0);

    Event.RC = false;

    Event.Value = "";

    } / / end new test

    } / / end of custom script validataion

    }) ();

  • Power of the exchange rate in numbers

    Hello

    I create a Position size in numbers calculator for managing risk in the trading game. More commercial instruments denominated in foreign currencies and to work on what I am risking in Australian dollars, I need exchange rate feed numbers to calculate. Most of the time it would be the rate of exchange between the Australia and the United States. Otherwise, I would have to manually enter the exchange rate.

    Is it possible to do, if so how? I guess one would use a site like Yahoo Finance!

    Thanks in advance...

    Graeme

    You can get a rate of Exchange directly in a cell numbers, where a spreadsheet formula can then access elsewhere in the sheet.

    Here's a script AppleScript to do this, and uses Ruby to request and return the exchange rate of Yahoo. The hypothesis of the AppleScript is that tell you him what cell you want released in the exchange rate, and you already have the open Numbers worksheet.

    Ruby code was borrowed from Github with the assignment of all destinies.

    The request to Yahoo returns a CSV table as [[l1, d1, t1, S, b, a]] where just the last trade price is captured (e.g. [1]). You can reference these and other symbols here:

    • s = symbol
    • L1 = last trade price *.
    • D1 = date of the last transaction
    • T1 = last trade times
    • b = the bid price
    • a = asking price
    1. Start your Script Editor (Launchpad: others: Script Editor)
    2. Copy and paste the following code in your Script Editor
      1. Click on the hammer to compile
      2. Click on the adjustment arrow to run it
    3. Save a copy of the script as (for example yahoo_exchg.applescript
      1. Script Editor menu: file: Save...
        1. Save as: yahoo_exchg
        2. Location: Documents
        3. File format: text (this will add .applescript to record under the name of file
        4. Hide the Extension: unchecked
        5. Save
    4. Save another copy of the RL script as an application (e.g. yahooX)
      1. Option key + Script Editor: File menu: Save under...
        1. Save as: yahooX
        2. Location: Office
        3. File format: Application (.app to yahooX adds)
        4. Hide the Extension: checked
        5. Save
    5. Double-click the yahoox on your desktop application.

    AppleScript code

    --

    -You can add to the list, and if you don't choose and click on 'OK', then you will

    -be invited to enter the string changes

    property exchg_list: {"AUDUSD', 'USDAUD', 'EURUSD', 'TRADER',"GBPUSD","USDGBP"}

    the value exchg_select to (choose from the list exchg_list ¬ fast

    ("Select your Conversion to Exchange" the default items ' ' with an empty selection allowed without selections multiples allowed)

    If exchg_select is false number error then -128

    If exchg_select is {} then

    display the dialog box "Enter symbols of Exchange as fromto (e.g. AUDUSD)" default answer ""-relief if not in the list

    new_exchg the value of text, return of result

    If new_exchg is not {} and length of new_exchg = 6 then

    the value exchg_select to the new_exchg

    on the other

    Display alert 'Need a pair of Exchange... quit smoking.' give up after 10

    return

    end if

    end if

    the value exchg_value to yahoo_exchange (exchg_select) as number

    say application "Numbers".

    say sheet active of the front document

    say table 1

    Set myRange to range "A2:A2".

    set value of cells of "MaPlage" to exchg_value

    end say

    end say

    end say

    return

    on yahoo_exchange (astring)

    return the shell script "" ruby < < "EOF"-"& astring &".

    #! / usr/bin/ruby

    # coding: utf-8

    # Influenced by https://gist.github.com/captainpete/1639522

    require 'csv '.

    "EXCHG = ARGV.join '"

    # get the exchange rate of Yahoo and return the last trade price

    class YahooExchange

    # set the default

    def self.fetch (code = 'AUDUSA')

    CS4L = %x (curl - q s------http://download.finance.yahoo.com/d/quotes.csv?s=#{code} = X & f = sl1d1t1ba & e =.) csv\ ")"

    . Flatten CSV.parse (cs4l) [1]

    end

    end

    print YahooExchange.fetch (exchg)

    EXPRESSIONS OF FOLKLORE. "

    end yahoo_exchange

  • Lost all my files stored on the left side and now 75 files of letters and numbers there that I cannot understand or get rid of

    I have been unable to send my mails but could receive. My wife has worked well. I copied his adjustment to my account. Still has not sent. In all of this, I lost all my saved files and my sent tab. Records used to be where I have all of these (about 50) files which consist of numbers and letters. I tried to remove my computer Thunderbird and reinstall it but when it comes I still have all these strange files. Just one Inbox, trash, and no record. I READ A LOT OF INFO BUT COULD NOT FIND ANYTHING TO FIX THIS PROBLEM.

    How do you have copied your settings of wives?

    Thunderbird seems to be confused, or by the location that you specified for your profile, or what it should display.

    How about a screenshot of what you see, so that we can in the picture. (These numbers and letters may be clue to what is there)

    See http://windows.microsoft.com/en-us/windows/take-screen-capture-print-screen#take-screen-capture-print-screen=windows-8

    Save your screen turned to a file and upload it with a message here in the forum.

  • capture multiple and reading images

    Hi all

    I use a Guppy F031 Pro camera equipped with trigger mode in bulk.  Now I can leave the exposure of the device twice in the series after an external trigger (my previous post).  But I don't know where are the stored images and how to read the two outside pictures and store them in the hard disk.

    When I use IMAQdx get image vi to capture image and set as number mode with 2 buffer pads.

    Does this mean that I assigned two location in RAM for my image?  If so, how can I find their location?

    Best,

    Wen

    "When I use IMAQdx get image vi to capture image and set as number mode with 2 buffer pads.

    Does this mean that I assigned two location in RAM for my image?  If so, how can I find their location? »

    -To my knowledge, it is false.

    Buffer allocation:

    -There are two types of internal buffers and buffer of the user you want to set up and use.

    -internal buffer is that you can configure using IMAQdx configure acquisition and giving the required number of buffers you want to allocate.

    -the user buffer is a condigure you or create using IMAdx create and giving them different middle names, creating several buffers. (You must remove the user buffers when finished processing using IMAQdx has, otherwise it will fill the RAM memory.

    Number of buffer:

    -A number of buffer is a zero-based index that represents the cumulative number transferred image. For example, during an acquisition continues with three internal buffers, the number of buffers is updated as follows: 0, 1, 2, 3, 4, 5 and so on. Buffer 0 and 3 numbers correspond to the same internal buffer in the ring of the buffer. (From NI IMAQdx manual)

    -Which means you will need to give different buffers number each time adding 1 whenever you receive an image. and not a constant of 2.

    For your question:

    -Configure the acquisition with more than two buffers, start the acquisition.

    -Give the number of buffers to 0 and increment after successful image and send it to IMAQdx get image.

    -For each image, your user buffer is even currently, which means that it will overwrite the same. If you want them to be different, you can create several and use also.

  • search for numbers in a large chain

    Hi all how I can search numbers in a big chain, for example the string is

    "23 (233).

    24 (456)

    25 (253)

    I ".

    23,24,25 are difficult numbers, but others are variable numbers that I need them and I mean chain is more please show her block really, I confused with string functions!

    It's the kind of problem that can be solved using regular expressions. The ^ anchor the match to the beginning of a line, so if you enter 51 in control of the resulting regular expression search string will be ^ 51\ ((\d+)------). The regex function will look like a line beginning with 51 [951 is therefore not a match], followed (, l ' Interior (\d+) parameter most is a capturing group that contains one or more numeric characters [must extend the bottom of the function regex match to get the output of the capturing group] and finally the closing). The opening and closing parentheses must be preceded by the escape character-because they are special characters.

    In this case, I assumed that the string is composed of several lines.

    Ben64

  • Use the table of numbers as "item select to compare.

    Greetings,

    I'm curious to know how to use an array of numbers as value in the tab select edit ideally my "case" would execute an expression "Contains(Locals.arrayofnumbers,0)."

    Basic principle:

    1 Labview VI launches with ListBox containing all tests (multiple selections enabled)

    OUTPUT is an array of I32.

    2 I32 table is attributed to Locals.arrayofnumbers

    3 Locals.arrayofnumbers is used with the element select 'compare '.

    4. each CASE has the statement... "next" Contains(Locals.arrayofnumbers,#)

    * each case would have 1 sequence to run *.

    Currently TS throws an error prompt indicating that the Select step expected number, that is the table of numbers.

    I already found a solution quick and pretty clean by instituiting just a condition prior to each sequence and captured to eliminate flow control all together. But I prefer not to use prerequisites for global flow control if possible and use controls to rate as expected.

    I have used TS help, but don't quite give me what I needed. Maybe I didn't use the correct search string. The forum here, is the same. I'm sure that the answer may be there, but maybe I'm using the wrong search string.

    Thanks in advance for any help.

    To SUM UP: User selects (via LabVIEW listbox) 1 - n tests to be run (output table I32). I32 table is used for the selection of the case by evaluating "contains (Local.arrayofnumbers, 0).

    Kind regards

    chazzzmd78

    Honestly, a Select System / box is the wrong choice for what you do.  I'd go with the prerequisite options.  It reduces the number of steps of TestStand.

    In your case you just to see whether something exists or not in a table.  Ideally, you will use the Select operations / box when you have 1 selected option of many.  I suppose you're a loop around the case select so that you can run all the tests so that your code looks something like this:

    For N (N is the number of tests they have selected)

    Select Locals.ArrayOfNumbers

    Briefcase (Locals.ArrayOfNumbers, 1).

    Run test 1

    Briefcase (Locals.ArrayOfNumbers, 2)

    Run the test 2

    Select close

    Closing loop

    If you want to use the Select option / box correctly I would like this:

    Item ForEach in Locals.ArrayOfNumbers (assign the item being Locals.i)

    Select Locals.i

    Case 1

    Run test 1

    Case 2

    Run the test 2

    Select close

    Close ForEach

    I hope that makes more sense.  If you have any questions let me know.

    Kind regards

  • How can I capture the time of startup and logon for XP users on my domain?

    How can I capture time (or time)
    -for users to access the logon screen (references)
    -users press OK after entering his credentials on the logon screen
    -Office XP that appear in a usable format moderately (for example, the user is able to open Explorer)

    We have problems with the connection of slow/slow start (SBSL) with Windows XP on the field and we would have 'real' numbers before you start so that we can have a base line and that you don't need to ask users what they mean when they say "it's a bit slower than usual" (and we'll know what stage of the startup procedure is slow). We would like to be able to capture (without intervention of the end user) following in a file or somewher event schedule so that we can measure how slow (or not), they are and what stage is slow, and what days it was slow. We are already capture the userenv logs.

    Hello

    Your Windows XP question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Windows XP Networking forum.

    http://social.technet.Microsoft.com/forums/en-us/category/windowsxpitpro

  • Capture a still image of a DVD

    I participated in an event that has published a 'official' DVD, which includes still photos and movies, music, and voice over. I want to "copy" a still image for transfer in a separate file (photo, document, whatever), so I could send it to others. I have permission to copy/burn the DVD, but all I want is an image that he. HP Pavilion, Vista. HP has not really helped.

    I participated in an event that has published a 'official' DVD, which includes still photos and movies, music, and voice over. I want to "copy" a still image for transfer in a separate file (photo, document, whatever), so I could send it to others. I have permission to copy/burn the DVD, but all I want is an image that he. HP Pavilion, Vista. HP has not really helped.

    ===================================
    Several programs that can do video screen capture:

    Screenshots
    =====================
    Windows Media Player
    =====================
    You can do a screenshot of Windows Media Player.

    Open Windows Media Player and go...
    Tools / Options / Performance tab / Advanced button...

    Uncheck the... "Use overlays" / OK / apply / Yes / OK...

    Now, play the video and put it paused on the screen you
    want to capture... now to make your print screen with Gadwin.

    Gadwin PrintScreen download screen
    http://www.Gadwin.com/download/
    (scroll down to: Gadwin PrintScreen 4.3 freeware)

    I put it so all I have to do is:

    (1) press... Print screen...
    (2) drag a box around the content I want to save...
    (3) press on enter...
    The screenshot is immediately saved as a .jpg file
    in a folder of my choice.

    =====================
    Media Player Classic
    =====================
    For the screenshots in Media Player Classic...
    Try the following steps...

    Open Media Player Classic and go... View.
    Options / Playback / Output in the right pane.
    tick... Default system / apply / OK

    Now play your video clip and type...
    ALT + I
    to make the capture. You don't have to take a break
    but it makes it easier to get the image you want.

    =====================
    VLC Media Player
    =====================
    For the installer for your screen Capture... Open VLC and
    Reach... Tools / Preferences / video button / video
    Instant image section.

    In the directory field... Search for and select a folder
    to save your captures po (for example... you could
    Create a new folder on your desktop and select)

    TO... Prefix... check the box... Sequential numbering.

    TO... Format, choose JPEG or PNG.

    Finally... on the left, click on the Save"" button.

    Now... Play the video and pause by pressing on your
    SPACEBAR when you see a screen you want to capture.

    To capture the screen... type...  SHIFT + S

    Press space to advance to the next photo...
    ect... etc...

    =====================
    Picasa
    =====================
    When you play a video in Picasa, you'll see a
    "Take Snapshot" button in the left pane.

    John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • DIRECTIONS: Print screen / Screen Capture on Gateway Tablet PC w / Windows Vista for photos/videos of office & Active Windows

    I try to use the screen capture / print screen on my gateway Tablet PC...

    I follow Windows help & support, yet when I try to paste it into Paint, it only will allow me the option "paste from ' and not 'stick' in the ' Edit '...

    What I am doing wrong? Should I do it differently on Gateway Tablet PC?

    -J' I NEED HELP from USER to Capture screen-Still and video Capture on the Windows desktop screen and the Options in the Active window.

    * The use of Screen Capture (Print Screen) on Gateway Tablet PC with the Windows Vista operating system:

    I followed HELP & SUPPORT directions exactly...

    * Gateway Tablet PC keyboard print screen says/labeled "Ins" button and immediately under the same button says "PrtSc".

    * "Help & Support" said to

    -Press the print screen key.

    -Open "paint."

    -Click on "Edit", then

    -Click "Paste"...

    Try clicking / use the "Paste" option in the "Edit" menu in the "paint" will NOT work:

    When I click on "Ins" / "PrtSc" button on a Gateway Tablet PC for the screenshot, I have:

    -Open Windows 'Paint' accessory,.

    -I click on "Edit" in the menu "painting."

    -'Paste' option is unavailable / greyed out. It will only allow me the option 'Paste From'

    -Option 'Paste From' does NOT work

    If you press your print screen and then open Paint... What is happening
    If you type...    CTRL + V...?

    Have you tried the tool capture of Vista? It is more versatile than print screen.

    Windows Vista - activate the Vista Snipping Tool
    http://www.PCWorld.com/article/137099/activate_vistas_snipping_tool.html

    Use capture tool to capture screenshots
    http://Windows.Microsoft.com/en-us/Windows-Vista/use-Snipping-Tool-to-capture-screen-shots
    (Vista Home Premium, Business, Ultimate, Enterprise)

    Vista tutorial - How to use the tool captures of Vista
    http://www.Vistax64.com/tutorials/148532-how-use-Snipping-Tool-Vista.html

    Info on the video capture:

    Vista's Movie Maker can capture screenshots:

    Windows Vista - Movie Maker-
    Take and use a picture from a video frame in Windows Movie Maker
    http://Windows.Microsoft.com/en-us/Windows-Vista/take-and-use-a-picture-from-a-video-frame-in-Windows-Movie-Maker
    Windows Media Player-
    Capture images from DVD in Windows Media Player or Real movie scenes
    http://labnol.blogspot.com/2005/11/capture-still-images-from-Windows.html

    VLC Media Player free software has also a good option for screen video capture...

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    VLC Media Player
    http://www.videolan.org/

    For the installer for your screen Capture... Open VLC and
    Reach... Tools / Preferences / video button / video
    Instant image section.

    In the directory field... Search for and select a folder
    to save your captures po (for example... you could
    Create a new folder on your desktop and select)

    TO... Prefix... check the box... Sequential numbering.

    TO... Format, choose JPEG or PNG.

    Finally... on the left, click on the Save"" button.

    Now... Play the video and pause by pressing on your
    SPACEBAR when you see a screen you want to capture.

    To capture the screen... type...  SHIFT + S

    Press space to advance to the next photo...
    ect... etc...

    Also... VLC Media Player... allows to save during video playback
    and will save the segment when you stop recording. It comes
    very useful if you need a small clip of a larger video file.

    VLC 1.0 records video of the DVD
    http://Lifehacker.com/5318807/VLC-10-records-video-from-DVDs

  • Nikon Capture NX2 freeze my computer

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas: I recently installed Nikon Capture NX2 photo editing software on my Windows Vista system. Almost everytime I start to edit a picture my computer crashes and I have to restart. What's not? How should I do?

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

  • Limiting the tables and using lindex in commands regexp

    Hello

    Here's my second and extremely crap question/post in what concerns the EEM/TCL.  I did some research on Google and have not really been able to find an answer to these questions.  Probably more due to my lack of agility with the search bar of the information being just is not there.  Hope you'll forgive me if.

    1. my first question is this.  Say I want to get an output of a command.  I would like to see all the interfaces in the 'ip vrf command show interface' for example.  Not knowing how many interfaces there may be, there could be 10, or there might be 200, what is the best way to limit a loop function after that I gave the following commands?

    Set _vrf_int [exec show ip vrf interface]
    Set _array_vrf_int [split $_vrf_int '\n']

    set $i 0

    then {$i< 200}="">
    RegExp {([A-Z]+[a-z]+[0-9]+). *} [lindex $_array_vrf_int $i] _complete_string _int
    Inc. $i 1

    }

    Not 100% sure that the syntax is correct, sorry.  If I don't have that 10 interfaces so it won't be necessary to issue this loop 200 times to "$_array_vrf_int".  Also wouldn't be great if I went through the 200 interfaces.  Is there a way I can limit this loop based on the number of lines that were captured after the split function?

    2. the value of the regular expression above is output in the var $_int.  Is there a way I can output the regular expression in a table? a ' :-

    RegExp {([A-Z]+[a-z]+[0-9]+). *} [lindex $_array_vrf_int $i] _complete_string [lindex $ $i _int]

    Syntax is certainly not correct, but I guess there could be a way to do this.  Any thoughts?

    3. I did some comparisons on an outing to see if an access list is present on an interface.  I can get a regexp to pull back the name of the access on a given interface list, but if there are any access-list to an if statement on anything?

    Set _acl_name 0

    RegExp {. * ip access-group (. *) in} $_running_int _complete_string _acl_name

    If {$_acl_name! = 0} {puts ' there is an access-list on $_int "} else {puts ' there is no acl on _int $ :-("} "}

    In the above output I'm defining the value of ' $_acl_name ' to zero so that I can compare it to the fi statement.  This seems to be a newbie to shit how do however.  Is it a kind of generic I put in place of the '0' to match an empty variable. has ' {null}.

    4 I'm sorry last question.  I also reset the variable {null} using a similar wildcard.  Once again I can reset the variable to 0, but it seems just that I do not understand that the syntax well enough and it is without doubt a better method.

    5. I have read several tutorials that cover a lot of bases.  Is there a good reference that anyone can suggest so I don't waste your time with these silly questions?  I'm afraid that the scripts I've studied on this forum are always way above my head.

    Thanks in advance

    Alex

    Assume that the limit of the loop.  Which will never end well.  Instead, use a foreach loop to iterate over the number of lines in the output:

    set vrf_int [exec "show ip vrf interface"]

    foreach line [split $vrf_int "\n"] {
      if { [regexp {([A-Za-z0-9]+).*} $line -> int_name] } {

    puts "Interface name is $int_name"

    }

    }

    In addition, do not use the variables that start with "_".  Those that are reserved for the Cisco or overall use.  In addition, 'exec' is a single command tclsh.  If you use the EEM Tcl, you will need to interact with the CLI library.  You can watch our best practices guide at https://supportforums.cisco.com/docs/DOC-12757 for some tips and tricks with the use of EEM.

    You can use - all and--inline for regexp all return in a list.  However, given the idea of the loop above, you can also use lappend to each pass:

    set intlst [regexp -all -inline {([A-Za-z0-9]+).*} $output]

    set vrf_int [exec "show ip vrf interface"]

    set intlst [list]

    foreach line [split $vrf_int "\n"] {
      if { [regexp {([A-Za-z0-9]+).*} $line -> int_name] } {

    lappend intlst $int_name

    }

    }


    You can use "info exist" or simply to check the result of your regexp command to see if a match took place.  See the example above the latter.

    regexp {.*ip access-group (.*) in} $_running_int _complete_string _acl_name

    if {[info exists $_acl_name]} {puts "there is a access-list on $_int"} else {puts "there's no acl on $_int :-("}

    You can 'reset' a variable by using the command 'deactivated '.

    One of the best general Tcl references is the "book of the pen:

    http://www.Amazon.com/practical-programming-Tcl-4th-Edition/DP/0130385603/ref=sr_1_2?ie=UTF8&QID=1333817448&SR=8-2

Maybe you are looking for