10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Test1.txt
Tom is hot
Test.sh
filename="/directory/Test1.txt"
set - A store
while IFS= read value
do
awk '{split($value,store," ")}'
done < "$filename"
echo ${#sore}
From the code in the executing file, I would like each... (8 Replies)
Discussion started by: TestKing
8 Replies
2. UNIX for Beginners Questions & Answers
value=malayalam
# i need to store the value in an array by splitting the character
#the output i need is
m
a
l
a
y
a
l
a
m
Please use CODE tags for output data as well as required by forum rules! (5 Replies)
Discussion started by: Meeran Rizvi
5 Replies
3. Shell Programming and Scripting
Hello, I have the following code:
while ($line = <fd_in>) {
126 $line = " " . $line ;
127 print "our_line:$line\n";
128 @list = split (/\s+/, $line) ;
129 print "after_split:@list\n";
130 print "$list\t$list\t$list\t$list\t$list\t$list$list\t\n";
131 $len =... (2 Replies)
Discussion started by: Zam_1234
2 Replies
4. Shell Programming and Scripting
Hi
Input:
{ committed = 782958592; init = 805306368; max = 1051394048; used = 63456712; }
Result:
A map (maybe Associative Array) where I can iterate through the key/value. Something like this:
for key in $map
do
echo key=$key value=$map
done
Sample output from the map:
... (2 Replies)
Discussion started by: chitech
2 Replies
5. Shell Programming and Scripting
KSH
HP-SOL-Lin
Cannot use xAWK
I have several strings that are quite long and i want to break them down into smaller substrings.
What I have
String = "word1 word2 word3 word4 .....wordx"
What I want
String1="word1 word2"
String2="word 3 word4"
String3="word4 word5"
Stringx="wordx... (5 Replies)
Discussion started by: nitrobass24
5 Replies
6. Shell Programming and Scripting
Hi all,
I want to split a string into array based on given delimiter, for example:
String:
"foo|bar|baz"
with delimiter "|"
into array:
strArr to strArr with values foo, bar and baz.
Thanks a lot.
Roy987 (5 Replies)
Discussion started by: Roy987
5 Replies
7. Shell Programming and Scripting
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
2 Replies
8. Shell Programming and Scripting
I want to run an awk split on a value that has been pushed through an array and I was wondering what the syntax should be??
e.g. running time strings through an array and trying to examine just minutes:
12:25:30
10:15:13
08:55:23
awk '
NR==FNR{
... (2 Replies)
Discussion started by: dcfargo
2 Replies
9. Shell Programming and Scripting
Collegues
I have flat file in the following format.
137 (NNP Kerala) (NNP India)
92 (NN Rent) (NN Range)
70 (NNP Thiruvananthapuram) (NNP Kerala)
43 (NNP Tourist) (NNP Home)
40 (NNP Reserve) (NNP Now)
25 (SYM @) (NN hotelskerala)
25 (NNP Thiruvananthapuram-695001) (NNP Kerala)
23 (NN... (3 Replies)
Discussion started by: jaganadh
3 Replies
10. Shell Programming and Scripting
Hello,
I am an intermediate scripter. I can usually find and adapt what I need by searching through previous postings, but I'm stumped.
I have a string with the format "{Name1 Release1 Type1 Parent1} {Name2 Release2 Type2 Parent2}". It is being passed as an argument into a ksh script. I need to... (5 Replies)
Discussion started by: drd_2b
5 Replies