Based on your requirements, the solution for step (2) can be very complex as you did not specify how many different
error codes exists, thus I just display the error and you can use another tool to count the different ones.
Here is what I came up with:
Code:
#!/usr/bin/ksh
typeset -i mCnt1=0
mLOrig='originNodeType : "IVR"'
mLVouch="voucher : '0'D"
mLProf='rProfileID : "ZZZZ"'
mLONType='originNodeType : "IVR"'
mLErr="errorCode :"
while read mLine; do
mP1to4=$(echo ${mLine} | cut -c1-4)
if [[ "${mP1to4}" = "TYPE" ]]; then
if [[ "${mLine}" = "TYPE1" ]]; then
if [[ "${mOrig}" = "Y" && "${mVouch}" = "Y" && "${mProf}" = "Y" ]]; then
mCnt1=${mCnt1}+1
fi
mType="1"
mOrig="N"
mVouch="N"
mProf="N"
else
if [[ "${mLine}" = "TYPE2" ]]; then
mType="2"
mONType='N'
else
mType="?"
fi
fi
fi
if [[ "${mType}" = "1" ]]; then
if [[ "${mLine}" = "${mLOrig}" ]]; then
mOrig='Y'
else
if [[ "${mLine}" = "${mLVouch}" ]]; then
mVouch='Y'
else
if [[ "${mLine}" = "${mLProf}" ]]; then
mProf='Y'
fi
fi
fi
fi
if [[ "${mType}" = "2" ]]; then
if [[ "${mLine}" = "${mLONType}" ]]; then
mONType='Y'
else
if [[ "${mONType}" = "Y" ]]; then
mP1to11=$(echo ${mLine} | cut -c1-11)
if [[ "${mP1to11}" = "errorCode :" ]]; then
echo "TYPE2 IVR ${mLine}"
fi
fi
fi
fi
done < input_file
echo "Found ${mCnt1} condition in TYPE1"
I have a flat file and need to count no of records in the file less the header and the trailer record.
I would appreciate any and all asistance
Thanks
Hadi Lalani (2 Replies)
Hello,
I searched the forums on the keywords in the title I used above, but I did not find the answer:
Is it possible to count records in a .zip file on an AIX machine if i don't have pkunzip installed?
From all the research I'm reading in google and the reading of pkunzip in Unix.com,... (3 Replies)
I have a text file which represents a http flow like this:
HTTP/1.1 200 OK
Date: Fri, 23 Jan 2009 17:16:24 GMT
Server: Apache
Last-Modified: Fri, 23 Jan 2009 17:08:03 GMT
Accept-Ranges: bytes
Cache-Control: max-age=540
Expires: Fri, 23 Jan 2009 17:21:31 GMT
Vary: Accept-Encoding ... (1 Reply)
Hi,
I have a pipe seperated file
I want to write a code to display count of lines that have 20th field not null.
nawk -F"|" '{if ($20!="") print NR,$20}' xyz..txt
This displays records with 20th field also null.
I would like output as: (4 Replies)
consider this as a csv file.
H,0002,0002,20100218,17.25,P,barani
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
D,1,2,3,4,5,6,7,8,9,10,11
T,5
N
i want to read the csv file and count the number of rows that start with D and... (11 Replies)
hi I want to write a script which count the number of subdirectories in the current root directory that contain more than a specified number of files of a specific type. Is there an easy way to do this?
Thanks
Robert (2 Replies)
Hi Gurus,
I need to count the duplicate records in file
file
abc
abc
def
ghi
ghi
jkl
I want to get below result:
abc ,2
abc, 2
def ,1
ghi ,2
ghi, 2
jkl ,1
or
abc ,2
def ,1 (3 Replies)
Hi Friends,
I looking for the script for the count of the records in table.
and then it's containg the zero records then should get abort.
and should notify us through mail.
Can you please help me out in this area i am lacking. (5 Replies)
Hello,
I have a table that looks like what is shown below:
AA
BB
CC
XY
PQ
RS
AA
BB
CC
XY
RS
I would like the total counts depending on the set they belong to:
if search pattern is in {AA, BB, CC} --> count them as Type1 | wc -l (3 Replies)
Discussion started by: Gussifinknottle
3 Replies
LEARN ABOUT PHP
locale_get_display_language
LOCALE_GET_DISPLAY_LANGUAGE(3) 1 LOCALE_GET_DISPLAY_LANGUAGE(3)Locale::getDisplayLanguage - Returns an appropriately localized display name for language of the inputlocale
Object oriented style
SYNOPSIS
publicstatic string Locale::getDisplayLanguage (string $locale, [string $in_locale])
DESCRIPTION
Procedural style
string locale_get_display_language (string $locale, [string $in_locale])
Returns an appropriately localized display name for language of the input locale. If is NULL then the default locale is used.
PARAMETERS
o $locale
- The locale to return a display language for
o $in_locale
- Optional format locale to use to display the language name
RETURN VALUES
display name of the language for the $locale in the format appropriate for $in_locale.
EXAMPLES
Example #1
locale_get_display_language(3) example
<?php
echo locale_get_display_language('sl-Latn-IT-nedis', 'en');
echo ";
";
echo locale_get_display_language('sl-Latn-IT-nedis', 'fr');
echo ";
";
echo locale_get_display_language('sl-Latn-IT-nedis', 'de');
?>
Example #2
OO example
<?php
echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'en');
echo ";
";
echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'fr');
echo ";
";
echo Locale::getDisplayLanguage('sl-Latn-IT-nedis', 'de');
?>
The above example will output:
Slovenian;
slovxc3xa8ne;
Slowenisch
SEE ALSO locale_get_display_name(3), locale_get_display_script(3), locale_get_display_region(3), locale_get_display_variant(3).
PHP Documentation Group LOCALE_GET_DISPLAY_LANGUAGE(3)