Sponsored Content
Top Forums Shell Programming and Scripting Count number of Nodes created and write it to a Log file Post 302329967 by phani333 on Monday 29th of June 2009 10:56:03 PM
Old 06-29-2009
Count number of Nodes created and write it to a Log file

Dear Experts,

I have to count the number of AddressRecords formed in bbc.xml file using unix script file. For example: for below pasted file, I need to write an output to a log file as "No. of Address Records Created=4".


Snippet of bbc.xml:-

Code:
  <?xml version="1.0" encoding="UTF-8" ?> 
- <ns0:MT_AddressDetails xmlns:ns0="http://CMS/AddressDetails">
+ <AddressRecords>
  <UniqueID>1</UniqueID> 
  <TransType>1</TransType> 
  <Name1>1</Name1> 
  <TelephoneNo1>1</TelephoneNo1> 
  <MobileNoEmail>1</MobileNoEmail> 
  </AddressRecords>
+ <AddressRecords>
  <UniqueID>2</UniqueID> 
  <TransType>2</TransType> 
  <Name1>2</Name1> 
  <TelephoneNo1>2</TelephoneNo1> 
  <MobileNoEmail>2</MobileNoEmail> 
  </AddressRecords>
+ <AddressRecords>
  <UniqueID>3</UniqueID> 
  <TransType>3</TransType> 
  <Name1>3</Name1> 
  <TelephoneNo1>3</TelephoneNo1> 
  <MobileNoEmail>3</MobileNoEmail> 
  </AddressRecords>
+ <AddressRecords>
  <UniqueID>4</UniqueID> 
  <TransType>4</TransType> 
  <Name1>4</Name1> 
  <TelephoneNo1>4</TelephoneNo1> 
  <MobileNoEmail>4</MobileNoEmail> 
  </AddressRecords>
  </ns0:MT_AddressDetails>

Thanks,
Phani Akella.

Last edited by Yogesh Sawant; 06-30-2009 at 03:49 AM.. Reason: added code tags
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File number count

hi all i want to count the number of files in a particlar dir i have wrote the codes as below fileCount= ls | wc -l if then echo " " elif then echo " " fi however when i excute the program there are error happens " unary operator expected" i just woundering fileCount=... (4 Replies)
Discussion started by: cryogen
4 Replies

2. Shell Programming and Scripting

scripting - write a script that will count the number of times a particular word

hello everyone, I'm trying to learn some scripts but i cant get my head around two of them. 1. how can i write a script that will count the number of times a particular word is used in file? 2. how can i make a script that will take me to a web page from unix? if anyone could help it... (3 Replies)
Discussion started by: BigTool4u2
3 Replies

3. Shell Programming and Scripting

d. Write a shell script to count the number of accounts which belong to particular primary

guys, I am new shelll scripting.. this a question on passt exam paper, I was trying to solve it , I can not. the question is as follow? a. Write a shell script to count the number of accounts which belong to particular primary group in a standard UNIX system which uses local... (1 Reply)
Discussion started by: gurmad
1 Replies

4. UNIX for Advanced & Expert Users

Count number of unique patterns from a log file

Hello Everyone I need your help in fixing this issue., I have a log file which has data of users logging in to an application. I want to search for a particular pattern in the log ISSessionValidated=N If this key word is found , the above 8 lines will contain the name of the user who's... (12 Replies)
Discussion started by: xtechkid
12 Replies

5. Shell Programming and Scripting

write specific line number in file

dear all, i need your advice i have sample script like this: testing.sh for i in {1..10} do echo testing $i done but i forgot create "#!/bin/bash" in above "for" so i want output will like this testing.sh #!/bin/bash for i in {1..10} do echo testing $i done (2 Replies)
Discussion started by: zvtral
2 Replies

6. UNIX for Dummies Questions & Answers

Count the lines with the same values in a column and write the output to a file

Hey everyone! I have a tab delimited data set which I want to create an output contained the calculation of number of those lines with a certain value in 2nd and 3rd column. my input file is like this: ID1 1 10M AAATTTCCGG ID2 5 4M ACGT ID3 5 8M ACCTTGGA ID4 5 ... (7 Replies)
Discussion started by: @man
7 Replies

7. Shell Programming and Scripting

How to count number of files in directory and write to new file with number of files and their name?

Hi! I just want to count number of files in a directory, and write to new text file, with number of files and their name output should look like this,, assume that below one is a new file created by script Number of files in directory = 25 1. a.txt 2. abc.txt 3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies

8. Shell Programming and Scripting

Remote nodes - login and find number of processes

Hello all, This is my requirement: 1. I have 6 VMs running Apache (for Oracle EBS) as Linux user oracle. 2. From a central server (VM), I need to login to all the 6 VMs as oracle user (I have already set up ssh equivalence, so it is password less authentication). 3. Find the number of... (4 Replies)
Discussion started by: sunpraveen
4 Replies

9. Shell Programming and Scripting

Count Segmentation fault and write to the file

Hi everyone Need to get version of npm application that have several output like this: root: nmp -version 10 root: nmp -version 10 root: nmp-new -version 3.1 root: nmp-old -version Segmentation fault count them , after that write to the file like this: 10 2 3.1 1 (1 Reply)
Discussion started by: indeed_1
1 Replies
Padre::Plugin::Snippet(3pm)				User Contributed Perl Documentation			       Padre::Plugin::Snippet(3pm)

NAME
Padre::Plugin::Snippet - TextMate-like snippets for Padre SYNOPSIS
cpan Padre::Plugin::Snippet Then use it via Padre, The Perl IDE. DESCRIPTION
Once you enable this Plugin under Padre, you'll get TextMate-style TAB triggered snippets for the following: Perl Moose Mouse MooseX::Declare Example For those who don't who this Text mate bloke is, just try to type in Padre something like: for<tab> if<tab> ife<tab> cfor<tab> While editing the generated construct, you can type again <TAB>. Your cursor will be moved to the next point needing some attention in the generated construct. You can check the available keyword in the yaml files (perl.yml...) shipped with this module. BUGS
Please report any bugs or feature requests to "bug-padre-plugin-snippet at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Padre-Plugin-Snippet <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Padre-Plugin-Snippet>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Padre::Plugin::Snippet You can also look for information at: o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Padre-Plugin-Snippet <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Padre-Plugin-Snippet> o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Padre-Plugin-Snippet <http://annocpan.org/dist/Padre-Plugin-Snippet> o CPAN Ratings http://cpanratings.perl.org/d/Padre-Plugin-Snippet <http://cpanratings.perl.org/d/Padre-Plugin-Snippet> o Search CPAN http://search.cpan.org/dist/Padre-Plugin-Snippet/ <http://search.cpan.org/dist/Padre-Plugin-Snippet/> SEE ALSO
Padre AUTHORS
Ahmad M. Zawawi <ahmad.zawawi@gmail.com> CONTRIBUTORS
Adam Kennedy <adamk@cpan.org> Kevin Dawson <bowtie@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ahmad M. Zawawi This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-03-27 Padre::Plugin::Snippet(3pm)
All times are GMT -4. The time now is 06:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy