10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have an array code and output is below:
echo $1
while read -r fline; do
echo "%%%%%%$fline%%%%%"
fmy_array+=("$fline")
done <<< "$1"
Output:
CR30903 YU0007 SRIL CR30903 Yogesh SRIL
%%%%%%CR30903 YU0007 SRIL%%%%%
%%%%%%CR30903 Yogesh SRIL%%%%%
... (8 Replies)
Discussion started by: mohtashims
8 Replies
2. UNIX for Beginners Questions & Answers
Hi,
Sure it's an easy one, but it drives me insane.
input ("|" separated):
1|A,B,C,A
2|A,D,D
3|A,B,B
I would like to count the occurence of each capital letters in $2 across the entire file, knowing that duplicates in each record count as 1.
I am trying to get this output... (5 Replies)
Discussion started by: beca123456
5 Replies
3. Shell Programming and Scripting
Hi All,
need help with reading the array and sum of the array elements.
given an array of integers of size N . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large.
Input Format
The first line of the input consists of an... (1 Reply)
Discussion started by: nishantrefound
1 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
I know how to merge two tables and to remove the duplicated lines based on a field (Column 2) . My next challenge is to be able to identify in a new column those common elements between table A & B, those elements in table A not present in table B and vice versa. A simple count would be... (6 Replies)
Discussion started by: lsantome
6 Replies
5. Shell Programming and Scripting
Hi I have two arrays :
@arcb= (450,625,720,645);
@arca=(625,645);
I need to remove the elements of @arca from elements of @arcb so that the content of @arcb will be (450,720).
Can anyone sugget me how to perform this operation?
The code I have used is this :
my @arcb=... (3 Replies)
Discussion started by: rkrish
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have an array containing following sample information
@array = qw (chr02 chr02 chr02 chr02 chr02 chr03 chr03 chr04 chr04 chr05 chr05 chr05 chr07 chr07) I need to replace all duplicate entries by an underscore to get the following output@array = qw (chr02 _ _ _ _ chr03 _ chr04 _ chr05 _ _... (4 Replies)
Discussion started by: pawannoel
4 Replies
7. Shell Programming and Scripting
hi
if i have arry with lots of intergers , how to check if there is duplicate integers
in perl ?
say I ahve @intergers=( 1,2,3,3,4,5,4,99,99,100) (2 Replies)
Discussion started by: james94538
2 Replies
8. Shell Programming and Scripting
Using Cygwin PDksh - But also have tested it on Linux with same results
----
I have a script that invokes a program/script and returns a string of data (1234 "12 34 56" 6789) and using "set -A" inserting it into an array.
script code snipit >>
get_array=$(php... (2 Replies)
Discussion started by: carlos25
2 Replies
9. Shell Programming and Scripting
Hi,
Please can someone help to return the array elements from a function. Currently the problem I face is that tempValue stores the value in myValue as a string while I need an array of values to be returned instead of string.
Many Thanks,
Sudhakar
the function called is:
... (5 Replies)
Discussion started by: Sudhakar333
5 Replies
10. Shell Programming and Scripting
Hi,
Is it possible to create a dynamic array in shell script. I am trying to get the list of logfiles that created that day and put it in a dynamic array. I am not sure about it. help me
New to scripting
Gundu (3 Replies)
Discussion started by: gundu
3 Replies