Hi, I'm working with my script like this.
First file -> help.sh - Below the text contained in the file:
--------------------------------------------------------------------------------
#!/bin/ksh
clear
awk -f help.awk help.txt > help.out
cat out
Secong file -> help.txt - Below the text contained the file:
7706 *** BSC South
UH05NPNDN8 (formerly
PLMN-PLMN/BSC-48637/BCF-70
BTS O&M LINK FAILURE
Started 2007-04-23 18:06:58
Third File -> help.awk - Below the text contained the file:
{
if ($1 == "BTS")
{
x = ""
x = substr($1,1,3)
print ""x""
}
}
-------------------------------------------------------
Output -> BTS. This means that if first word encounter BTS then it will go to the 'substr'. This works only for a multiple word in a line, but this is my problem.
If you can see this from my file help.txt 'PLMN-PLMN/BSC-48637/BCF-70' ,this is considered only as one word in a line. Here is what I want to get, that my output is '-BCF-70'. What should I represent in $1=="?????" to be the basis of my search string if there are no other words that I could use to make it.Can I use a delimiter,how? I talked to someone about this, he told me that I can use $0 , but how can I use that one here?..Thanks.
FYI.