10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Experts
I need your help to optimize my script to execute better as I have nearly 1M records & the script is taking close to 40 minutes to execute, so would need support on a faster alternative.
Input: file
{"house":"1024","zip":"2345","city":"asd","country":"zzv"}... (2 Replies)
Discussion started by: nk1984
2 Replies
2. Shell Programming and Scripting
How can I extract digits at the end of a string in UNIX shell scripting or perl?
cat file.txt
abc_d123_4567.txt
A246_B789.txt
B123cc099.txt
a123_B234-012.txt
a13.txt
What can I do here? Many thanks.
cat file.txt | sed "s/.txt$//" | ........
4567
789
099
012
13 (11 Replies)
Discussion started by: mingch
11 Replies
3. UNIX for Beginners Questions & Answers
I have this 5GB file, and i want to extract from the file particulars pattern.
this is my script:
//
count=`grep -wc "MSISDN" file_name`
k=1
>OUTPUT
>OUTPUT_Final
while
do
cat file_name | awk -F":" -v var="$k" '$1=="MSISDN" {m++}m==var{print; exit}' >> OUTPUT
cat file_name |awk -F":"... (33 Replies)
Discussion started by: gillesi
33 Replies
4. Shell Programming and Scripting
Hi all,
Please, i'd like to extract string just before '.fr'.
Here is some lines of my file:
g-82.text.text1.fr.worker1
g-xx.yyyyyy.zzzz.fr.worker2
i'd like to extract this text:
g-82.text.text1
g-xx.yyyyyy.zzzz
Please, which command i have to use in my script shell ?
... (16 Replies)
Discussion started by: chercheur111
16 Replies
5. Shell Programming and Scripting
Hi,
I have a file which I need to programmatically split into two files.
All the information in the file before pattern "STOP HERE" is to be stripped and output into one file while everything after "STOP HERE" is to be output into a separate file.
I would appreciate help on how to do... (8 Replies)
Discussion started by: PTL
8 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I am trying to to compare a string variable with a string literal inside a loop but keep getting the
./testifstructure.sh: line 6:
#!/bin/sh
BOOK_LIST="BOOK1 BOOK2"
for BOOK in ${BOOK_LIST}
do
if
then echo '1'
else
echo '2'
fi
done
Please use next... (1 Reply)
Discussion started by: daveu7
1 Replies
7. Shell Programming and Scripting
Hello,
I have a file whose contents look as follows
<ID="24" name="Kobe Bryant" Position="Shooting Guard">
<name="Artest" Position="Forward" ID="37">
I need to get the output which contains everything in the quotes for Position (Shooting Guard and Forward). I tried this but it doesn't work... (3 Replies)
Discussion started by: grajp002
3 Replies
8. Shell Programming and Scripting
...Software and Disk information...
Hey guys....
I need to extract a bunch of information from a set of servers running Solaris 10 where I need to know for each server:
- all OS Versions and patch levels
- 3rd party COTS or opensource software/processes running on all servers (several... (0 Replies)
Discussion started by: northern1969
0 Replies
9. Shell Programming and Scripting
Hi All,
I am new to this shell scripting world. Struck up with a problem, can anyone of you please pull me out of this.
Requirement : Need to get the index of a substring from a parent string
Eg : index("Sandy","dy") should return 4 or 3.
My Approach :
I used Awk function index to... (2 Replies)
Discussion started by: sandeepms17
2 Replies
10. Shell Programming and Scripting
I have a long string "<ID type="Oid">{}</ID>"
I need to extract "GigabitEthernet0/1" from the above string.
How can it be done? :) (5 Replies)
Discussion started by: girisha
5 Replies