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 =~...
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
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
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...
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
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...
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...
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...
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
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
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.
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
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.