06-10-2004
thanks guys.. for ur look into...
I still have the problem...
zazzybob.... let me chart the flow of the code
1> Every record will be between two "=============" . This is pretty clear from the sample i posted.
2> If we have "Ref: yes" in the line which contains the pattern "Primary" , then we pick up the field "PN-phase: ??????? " from the line next to it( that contains "Primary") and also
3> In case we have "Ref: no" in the line which contains the pattern "Primary" , then we pick up the field "Pn_offset: " from the immediate next line that has "Ref: yes" .
e.g
=======================================================================
Record: 42759421 Version: 2 Timestamp: Wed Jun 9 15:00:09 2004
Primary (Reporting) Cell: 25 Sector: 2 Carrier: 2 Ref: no Event: 20984
Missing Pilot: Keep: 1 PN-Phase: 0x50fc Strength: 29
Secondary Sector Information:
Slot 1: Keep: 1 Pn_offset: 84 Strength: 27 Ref: no
Slot 2: Keep: 1 Pn_offset: 480 Strength: 29 Ref: yes
=======================================================================
in this case the o/p will look like
SOURCE SECTOR PNPHASE LEVEL REFERENCE EVENTNO
25 2 0x50fc -14.5 480 20984
Whereas as in this case
=======================================================================
Record: 42759422 Version: 2 Timestamp: Wed Jun 9 15:00:10 2004
Primary (Reporting) Cell: 14 Sector: 2 Carrier: 2 Ref: yes Event: 12583
Missing Pilot: Keep: 1 PN-Phase: 0x5b88 Strength: 26
Secondary Sector Information:
Slot 1: Keep: 1 Pn_offset: 381 Strength: 24 Ref: no
Slot 2: Keep: 1 Pn_offset: 54 Strength: 29 Ref: no
=======================================================================
the o/p will be
SOURCE SECTOR PNPHASE LEVEL REFERENCE EVENTNO
14 2 0x5b88 -13 SAME 12583
....
PLS HELP
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi there
i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format
but i get an error
please can anybody help me out in this problem ??????
i give my code here including error
awk `
# date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies
2. Shell Programming and Scripting
I am getting this error:
awk: cmd. line:1: BEGIN {print "Userid Shell" }
awk: cmd. line:1: ^ syntax errorBased on this script:
#!/bin/bash
awk -F":" \
'{
BEGIN {print "Userid Shell" }
loginname=$1
optionalpass=$2
numericuserid=$3
numericgroupid=$4
username=$5
userhomedir=$6... (1 Reply)
Discussion started by: holocene
1 Replies
3. Shell Programming and Scripting
Hello all,
Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val:
> cat getnon0file.sh
#!/bin/bash
this="getnon0file.sh"
USAGE=$this"
InFile="xyz.38"
Min="0.05"
#
awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies
4. Shell Programming and Scripting
Hi Friends,
the below script has been through the errors in sun solaris.
awk '/%s/{f=0 ;n++; print >(file="OUT_" n); close("OUT_" n-1)} f{ print > file}; /%s/{f=1}' $BASE_DIR/concat.TXT
awk: syntax error near line 1
awk: bailing out near line 1
And
ls $MERGE_DIR/*.R | awk '
{
... (2 Replies)
Discussion started by: krbala1985
2 Replies
5. Shell Programming and Scripting
Hi,
I run an awk script and I got the error attached below:
here are the lines that the compiler point to as an error:
duration = timeEnd1-timeBegin1;
print "Transmission: type of traffic " flow1 ;
print - Total transmitted bits = totalBits1 bits;
print - duration = ... (2 Replies)
Discussion started by: ENG_MOHD
2 Replies
6. Shell Programming and Scripting
STRING1=JAVA
CONTENTS=$(awk -v x="$STRING1" '$0 ~ x { print ll } { ll = $0}' $LOGFILE | tail -150 | egrep "Jan |Feb |Mar |Apr |May |Jun |Jul |Aug |Sep |Oct |Nov |Dec " | cut -c6-1000 | tail -1)
When I run the above from a script, i get the following errors:
syntax error at -e line 1,... (1 Reply)
Discussion started by: SkySmart
1 Replies
7. Shell Programming and Scripting
I've found this script which seems very promising to solve my issue:
To search and replace many different database passwords in many different (.php, .pl, .cgi, etc.) files across my filesystem.
The passwords may or may not be contained within quotes, single quotes, etc.
#!/bin/bash... (4 Replies)
Discussion started by: spacegoose
4 Replies
8. Shell Programming and Scripting
I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks
sh: -c: line 0: syntax error near unexpected token `newline'
sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies
9. Shell Programming and Scripting
Hello Team,
I am using below awk code in the script
ssh -o ConnectTimeout=15 -n -l USER SERVER awk -F'\;' '{ if ( $3 == '-' && $1 ~ // ) print }' *20130706*
but its giving error as
awk: syntax error near line 1
awk: illegal statement near line 1
Please help.
... (6 Replies)
Discussion started by: skhichi
6 Replies
10. Shell Programming and Scripting
Hello im new here... Im trying to read file and create folders from words in it but i get this for loop error
awk : line 3 : syntax error at or near for
my code is..
#!/bin/bash
begin
for (( i=1;i<=5;i++));
do
awk -v i=$i $0 { print $i }
mkdir $i
done
{print $i}
end {}
i have... (7 Replies)
Discussion started by: boxstep
7 Replies
LEARN ABOUT DEBIAN
tangram::type::ref::frommany
Tangram::Type::Ref::FromMany(3pm) User Contributed Perl Documentation Tangram::Type::Ref::FromMany(3pm)
NAME
Tangram::Type::Ref::FromMany - map references to persistent objects
SYNOPSIS
use Tangram;
# or
use Tangram::Core;
use Tangram::Type::Ref::FromMany;
$schema = Tangram::Schema->new(
classes => { Company => { fields => {
ref => [ qw( ceo vice_ceo ) ]
# or
$schema = Tangram::Schema->new(
classes => { Company => { fields => {
ref =>
{
ceo =>
{
col => 'ceo',
null => 0
},
vice_ceo =>
{
...
}
DESCRIPTION
This class is responsible for mapping fields that contain a reference to a Perl object. The persistent fields are grouped in a hash under
the "ref" key in the field hash.
The target object must belong to a persistent class.
Tangram uses a column on the source object to store the id of the target object.
The persistent fields may be specified either as a hash or as an array of field names.
In the hash form, each entry consists in a field name and an associated option hash. The option hash may contain the following fields:
* aggreg
* col
* type_col
* class
* null
* deep_update
Optional field "aggreg" specifies that the referenced element (if any) must be removed (erased) from persistent storage along with the
source object. The default is not to aggregate.
"col" sets the name of the column that contains the target object's id. This field is optional, it default to the persistent field name.
You need to specify a column name if the field name is not an allowed SQL column identifier.
"type_col" sets the name of the second column, that contains the target object's type id. This field is optional, it default to the value
of "col" with ""_type"" appended. Set to the empty string ("") to disable this column, which requires that you also specify a class.
"class" specifies the base class of the reference, which automatically disables "type_col" (currently unimplemented).
"null", if present and set to true, directs deploy() to generate SQL code that allows NULL values for that column.
Optional field "deep_update" specificies that the target object has to be updated automatically when "update" is called on the source
object. Automatic update ensures consisitency between the Perl representation and the DBMS state, but degrades update performance so use it
with caution. The default is not to do automatic updates.
warning: there is currently something of a bug with all deep_update collections. If you (for instance) insert an object, and a property of
that object that is deep_update, then sometimes things end up getting inserted twice - especially in mapping tables. This is currently
under investigation.
You may also pass the names of the persistent fields in an array, in which case Tangram uses the field names as column names and allows
NULL values.
IMPLEMENTATION NOTES
INHERITANCE
Ref directly inherits from Tangram::Type::Scalar, and indirectly from Type.
STORING REFERENCES
When Tangram stores a reference to another object, it stores the target object's OID in the source object's table, just like what happens
with other scalar types like String and Number.
At least that's what basically happens, but there can be complications.
Complication #1: the target object is not persistent yet. Thus it doesn't have an OID yet. Tangram will attempt to store the target object;
if this succeeds, the target object gets an OID too and Tangram can proceed.
Complication #2: Tangram may detect that the target object is already being saved; this happens in presence of cycles. Let's take an exam-
ple:
$homer = Person->new();
$marge = Person->new();
$homer->{partner} = $marge;
$marge->{partner} = $homer;
$storage->insert( $homer );
What happens here? Tangram detects that $homer refers to $marge, and that $marge is not yet persistent. So it ignores $homer for a while,
and proceeds to storing $marge.
In the process, Tangram sees that $marge refers to $homer - which is not persistent yet! its insert() is suspended. Fortunately Tangram
realizes that, and doesn't attempt to store $homer again. Instead it stores a NULL in the 'partner' column of Marge's row.
Tangram also schedules an UPDATE statement that will be executed just before returning from the call to insert(). That statement will patch
Marge's 'partner' column with the proper OID.
LOADING REFERENCES
Tangram never loads the target object in the process of retrieving the source object. Doing so could have disastrous consequences. For
example, consider a family tree, where each Person has a reference to Mom and Dad. Pulling any single Person would eventually retrieve
everybody up to Adam and Eve! If Tangram did work that way, that is...
Instead, Tangram ties all the fields that are declared as outgoing references to a package (Tangram::Lazy::Ref). The underlying object
keeps track of the source object's OID, the Storage object, and the name of the persistent field.
When - if - a reference field is accessed, the target object is pulled from the database (if it's not already present in memory), and the
field is untied and its value is replaced with a reference to the target object. As a result, the target object is loaded on demand, but in
an almost transparent fashion (why almost? because you can always use tied() on the field and detect that strange things are taking place).
perl v5.8.8 2006-03-29 Tangram::Type::Ref::FromMany(3pm)