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 Mike Lewis 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: *

  1. mikawin

    Define Hash with $1 & $2

    Duh, me! Once I printed $1 and $2 out, got it figured. Mental note - check the obvious before posting a query. Thanks dmazzini. ~MW
  2. mikawin

    Define Hash with $1 & $2

    I have a file with 5 columns and want to use the data in the file to define a hash with key-value pair as shown below: key - c1, c2, c3 value - c1, c2, c3, c4, c5 my(%myHash); my ($c1, $c2, $c3, $c4, $c5); open(IN,"file1") while(my $current = <IN>) { $current =~...
  3. mikawin

    Splice Arrays

    Hello, I have a set of arrays: @Arr1 = (1..20); @Arr2 = (16..41); @Arr3 = (46..109); I want to splice the above into 1 array without duplicates of the format: @Combined = (1..41, 46..109) How can I do this? Thanks, Mika
  4. mikawin

    Find data in file corresponding to a search criteria

    Thank you rharsh for your suggestion. Is it possible to assign the value of this search to an array, since I will be checking the contents of the array for a downstream process. Thanks, Mika
  5. mikawin

    Find data in file corresponding to a search criteria

    Hello, I have a file with 3 columns. I want to get data corresponding to Col3 based on matching criteria in Col1. For example my searchInFile.txt contains: 100 P 24 200 Q 31 300 R 65 200 S 41 I need to extract Col3 corresponding to all values that match 200 in Col1. In Unix, I can do...
  6. mikawin

    One liner to check if variable matches any of an array's elements

    Hi, Is there a one-liner code that will check to see if a particular variable's value (for e.g $myVar = "S") matches any of the elements of a pre-defined array( @myArray = (P Q R S)? Thanks, Mika
  7. mikawin

    Join Two Tables using Perl

    Hello, I have two tables of 70*10^3 and 800*10^3 rows each. I want to get data corresponding to the columns 1, 2 and 3 of the first table from the second table. Sample Data: Table 1 1 PQRS STUV 2 ABCD EFGH 3 HIJK LMNOP Table 2 1 PQRS STUV 987 654 321 2 ABCD EFGH 1275 1375...
  8. mikawin

    Insert data from a file to a hash

    Thanks Chris, Using the module sped things up for me immensely. ~Mika.
  9. mikawin

    Splitting and using variables as inputs for a function

    mikrom, Thanks for your input. Basically my code was to replace characters in the input string with the replace character I feed. However for the ones where it did not work, it turns out that the input character was the same as the replace character. (With over 1^10x7 strings, I will have to...
  10. mikawin

    Splitting and using variables as inputs for a function

    Hi mikrom, Here is a sample: $inString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' $replaceString = '6,1,X;23,1,C;19,1,R;4,1,Y;5,1,P' @replaceArray = split( ";", $replaceString); foreach $elements (@replaceArray) { ($offset, $len, $replace) = split(",", $elements); substr($inString...
  11. mikawin

    Splitting and using variables as inputs for a function

    Hello, I have a column of data that is of the following format: 611,1,X;323,1,C;209,1,R;119,1,Y;86,1,P I am splitting a field based on ';' and on each of the split values calling on a function (an arbitrary example is the substring function.) Substring works on all of the values except the...
  12. mikawin

    Insert data from a file to a hash

    I have about 500,000 records in a file that I want to insert into a hash table. What is the most efficient way to do this? Thanks, Mika
  13. mikawin

    replace characters of a string in specified position(s)

    I want to replace characters in specified positions for a series of strings. An arbitrary example: String Input: XXXyRRRtF8 Replace 4th & 8th characters 'y' and 't' with '1' & '2' respectively to give the output: XXX1RRR2F8 Thanks for your help! ~Mika
  14. mikawin

    Oracle Express Edition Export Results

    Hello KenCunningham, No, it does not work. I have tried opening with a notepad and couple of other text editiors, it still gives me only 65,000 records. Thanks, Mikawin
  15. mikawin

    Oracle Express Edition Export Results

    Hello William, Yes I am using Oracle Application Express. Thanks, Mikawin
  16. mikawin

    Oracle Express Edition Export Results

    Hello, I am using the web based Oracle Express Edition. When I am trying to save the results of my query, it exports it as .csv. Is it possible to change this? The .csv format truncates to the results to 65,500 records and I have more than this in my result set. Thanks, Mika.
  17. mikawin

    compare two column values

    No worries, used a hash and cut the code. Thx, Mika
  18. mikawin

    compare two column values

    Well, I split the Col3 field and first did the number comparison and then compared the letters with the two columns. This works, but it seems too convoluted. Hence the question to the forums. Thx, Mika
  19. mikawin

    compare two column values

    Hello, I have three columns with data (shown with space delimiter) that look like: Col1 Col2 Col3 -------------- x y y=6/x=7 a b a=9/b=4 p q p=6/q=8 r s s=6/r=4 I want to pick the high value for each row and have it output to the 4th column with information as to which Col has the high value...
  20. mikawin

    Join from Multiple Tables

    Sorry SantaMufasa, I created an arbitrary 2nd table and did not realize that I had duplicated rows. So the data from 1st table is: Col1 Col2 1 13172 1 13934 1 15030 1 15544 1 16007 1 16326 1 16357 1 17153 My output should be (sans duplicate rows) is: Col1 Col2...

Part and Inventory Search

Back
Top