Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: stevio
  • Content: Threads
  • Order by date
  1. stevio

    Multiple Listboxes into single array

    Hi There, Is it possible to add multiple listbox items into a single array? The code below works for a single Listbox1, how do I add a second Listbox to the end of the first array, e.g. Listbox1 Private Sub CmdOk_Click() Dim myArray() As String Dim Count As Integer, i As Integer, j As Integer...
  2. stevio

    Word VBA - finding which order checkboxes are selected

    Hi there, I have a form which has a number of checkboxes. Is it possible to capture and store the order in which the checkboxes were selected in an array? So if there are 20 checkboxes and the user selects CheckBox1, CheckBox3, Checkbox18, I want to capture the Control.Value (which I assume is...
  3. stevio

    Regex Number with or wothout thousands separator

    Hi all, Have a number which can be a 1 or more digits. Max number has thousands separator Trying to work out a regex to match any of these: '345' -match '(\d{1,})' "Number is $($matches[1])" Works for single digit and 3 digit numbers and '3,345' -match '(\d{1}\,\d{1,3})' works for 4...
  4. stevio

    Word VBA - Create Table and Populate

    Trying to use VBA to create a table using bookmarks in Word 2010 from a Userform with 2 columns and row based on number of checkboxes ticked. Then populate just the first column with predefined text and the row number The second column, would contain the Caption or name of the checkbox. I...
  5. stevio

    Find if Hash Value exists in Hash of Arrays

    Hi there, If I have a Hash of Arrays, how to you find out if a value exists for a given key. use Data::Dumper; #populate hash foreach (1 .. 4) { push @{ $hash{key1} }, $_; } foreach (5 .. 9) { push @{ $hash{key2} }, $_; } So if I wanted to find out if '1' exists in key1, how do I...
  6. stevio

    Import CSV into Excel by Column Name

    Hi There, I have the following code to import a csv file into Excel: Sub ImportCSV() Dim vPath As Variant Dim wb As Excel.Workbook Dim ws As Excel.Worksheet Set wb = Excel.ActiveWorkbook Set ws = Excel.ActiveSheet vPath = Application.GetOpenFilename("CSV (Comma Delimited) (*.csv),*.csv" _...
  7. stevio

    Process Array in batches

    I have an array of integers and the array size is variable ,it is determined at processing time. What I need to do is to work out how many elements there are in the array and process each element with no more than 50 at a time. So, if there are 320 elements, then I need to process them in 6...
  8. stevio

    Regex multiple times per line

    Have the following data in a text file: 0 0-0 1-0 2-0 3-0 0-1 1-1 2-1 1 0-2 1-2 2-2 3-2 0-3 1-3 2-3 2 0-4 1-4 2-4 3-4 0-5 1-5 2-5 3 0-6 1-6 2-6 3-6 0-7 1-7 2-7 ... etc...
  9. stevio

    How to delete empty hash element

    Using Data::Dumper module I can see an empty hash element, in this case $VAR1/$VAR2 $VAR1 = ''; $VAR2 = {}; $VAR3 = '5'; $VAR4 = '7'; etc How do I check and remove empty hash elements? Do I use undef?
  10. stevio

    Regex help please

    Have some data like the following Product : CCS SerialNumber : 75010010 LUs : 2 iLU HDevName OSPathID PathID ChaPort Status Type 0026 hdisk24 00000 000018 1A Online Non 00001 000019 0A Online Own 0148 hdisk29 00000 000020...
  11. stevio

    Split function

    Have simple piece of code $string = "1234"; @val = join(':',split(//,$string,2)); print @val; __RESULT__ 1:234 How can I get the result like 12:34 instead using the join function? Is the only way to do this? @val = split (//,$string); print $val[0].$val[1].":".$val[2].$val[3];
  12. stevio

    Regex multiline

    All tried performing a regex over multi-line text like so while (<DATA>){ print "$1\t$2" if /Name=(.+)Work=(.+)/s; } __DATA__ Name=Paul Phone=555-555-555 DOB=09/09/08 License=456332 Work=Doctor .....loop through list Data has spaces at the beginning...
  13. stevio

    Regex Result into Hash (and file)

    I run a command which has the following results from STDOUT: Serial=102345 Name=Server1 Type=Windows .... Serial=345069 Name=Server2 Type=Linux ... etc How do I place each combo of serial and type into a hash for easy reference my %hash; my @cmd = `command`; foreach $line(@cmd) {...
  14. stevio

    Regex print first instance

    Hi there, Have a simple script which runs a command on the system and returns the regex value my @val = `command here`; foreach $line(@val) { if ($line =~ /(test\d+)/){ print "$1\n"; } } The question is, I only want to print...
  15. stevio

    Parsing CSV file

    Have script which parses a CSV file which looks like the following Date and Time Number Total I/O /sec More columns 08 09 2007 18:00:00 00:00 2.2733333 08 09 2007 18:00:00 00:01 0.033333335 08 09 2007 18:00:00 00:02 0.036666665 08 09 2007 18:00:00 00:03 1.1433333 08 09 2007 18:00:00...
  16. stevio

    Reading Text File into Array and performing operations

    I've got a set of data in a text file which looks like the following: Data1 Data2 Data3 0 0 23 0 1 0 0 2 3 ... 1 0 45 1 1 23 1 2 0 The number of rows is totally variable There are 2 halves...
  17. stevio

    Regex - Search within section

    Hi all, I'm trying to build a regex which will allow me to search a text file between sections So the data looks like this, the data begins after Data1 Data2 Data3 and ends when the next line is: Data4 Data5 Data6 ---- Section 2 ---- Data1 Data2 Data3 0 0 30 0 1 0 0 2...
  18. stevio

    Regex Text File and format output

    Hi all, I'm trying to search a text file for 2 values using regex and format the output so that the values are side by side in a tab delimited format Text file looks like this. 'Val' is constant, but the number after Val will be different ---------------------------- Value Val 1 . . more...
  19. stevio

    Regex and reading text file

    Have a text file which looks like the following: txt1 1001 txt1 1002 txt1 1003 txt1 1004 txt2 1005 txt2 1006 txt2 1007 txt2 1008 txt2 1009 txt3 1010 txt3 1011 txt3 1012 etc Each block can have different number of lines I want to be able to loop through each line of...
  20. stevio

    Using Mod for Odd/Even

    All, Trying to take variables from the command line and using modulus to check that all variables are either all odd or all even. example of all even numbers might be var1 = 10 var2 = 0 var3 = 4 example of all odd numbers might be var1 = 11 var2 = 1 var3 = 3 So code to check for odd is...

Part and Inventory Search

Back
Top