11-12-2007
to grep and find the count
Hi
My files is like
a|test|s|
b|test2 | n|
c|ggg|v|
i want to count the no of lines which is ending with "|" ...
Please let me know how can it be done.
Thanks,
Arun
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to count the number of instances of a dir in a set of dir with the same suffix .txt (one dir and all recursive directories).
<Main Dir>
<sub_dir1>
<sub_dir2>
<sub_dir3>
<sub_dir4>
and count the number of instances of a type of file, ie/ .txt files (3 Replies)
Discussion started by: t4st33@mac.com
3 Replies
2. UNIX for Dummies Questions & Answers
The following command lists the files which has "wPOREQ" in the files whose names are like:M*08042007*
grep -l "aaa" M*08042007*
I want to know the count of the files.
Thank you for the help. (2 Replies)
Discussion started by: sudheshnaiyer
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I trying to sort information in a file by making count for every object. For example:
A
B
A
D
A
B
C
i would like to sort out count for each object (A's, B's and etc) but in actual case i dont know the object but i know the position ofthe object. do i need to use array as well? Any... (2 Replies)
Discussion started by: sukhpal_78
2 Replies
4. UNIX for Dummies Questions & Answers
Hi, I have several files with same filename pattern. I want to calculate count of individual files using grep/egrep. Let me be more descriptive
In directory E1 i have files like
ab_20091201_12:24 ab_20091201_03:24 cd_20091201_04:16 cd_20091203_08:34 ef_20091201_06:12 ef_20091201
Now i want... (3 Replies)
Discussion started by: shounakboss
3 Replies
5. UNIX for Dummies Questions & Answers
How do I do a grep wc that counts occurences of two or more different strings?
If I have string1 two times and string2 three times, how do I use wc to get the number 5? (1 Reply)
Discussion started by: locoroco
1 Replies
6. UNIX for Dummies Questions & Answers
I have a delimited file (by |), and the second field is made out of Surnames.
Is it possible to list the surnames together with their count of occurances.
For example, image the first two lines are the following:
Joe | Doe | 30
Jane | Doe | 28
Peter | Smith | 25
John | Jones | 26
I... (2 Replies)
Discussion started by: mouthpiec
2 Replies
7. Shell Programming and Scripting
Hi All,
This is the first time I have posted to this forum so please bear with me. Thanks also advance for any help or guidance.
For a project I need to do the following.
1. There are multiple files in multiple locations so I need to find them and the location. So I had planned to use... (9 Replies)
Discussion started by: Charlie6742
9 Replies
8. Shell Programming and Scripting
got a file as y.txt
1 abc,def,ghj
2 defj,abc.kdm,ijk
3 lmn,cbk,mno
4 tmp,tmop,abc,pkl
5 pri,chk,cbk,lmo
6 def,cbk.pro,abc.kdm
i want to search in the above file the key word like abc
looking for two outcomes by passing the parameter value as abc into function and the two outocmes are... (0 Replies)
Discussion started by: silgun
0 Replies
9. Shell Programming and Scripting
Hi Friends,
I want to find all processes beginning with the name 'Admin' and then do a grep count on those processes containing a specific string i.e. However, it is giving below error
ps -ef | grep ^Admin | grep -ic 'Jan' -e 'Feb' -e 'Mar'
grep: Jan: No such file or directory
... (4 Replies)
Discussion started by: srkmish
4 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output
Here is how my file looks like
1.1.1.1
1.1.1.2
1.1.1.3
1.1.2.1
1.1.2.2
1.1.3.1
1.1.3.2
1.1.3.3
1.1.3.4
So what I am trying... (2 Replies)
Discussion started by: new2prog
2 Replies
LEARN ABOUT ULTRIX
dwtopenhierarchy
DwtOpenHierarchy(3Dwt) DwtOpenHierarchy(3Dwt)
Name
DwtOpenHierarchy - Allocates a hierarchy ID and opens all the UID files in the hierarchy.
Syntax
#include <X11/DwtAppl.h>
Cardinal DwtOpenHierarchy(num_files, file_names_list, ancillary_structures_list,
hierarchy_id_return)
DRMCount num_files;
String file_names_list [];
IDBOSOpenParamPtr *ancillary_structures_list;
DRMHierarchy *hierarchy_id_return;
Arguments
num_files Specifies the number of files in the name list.
file_names_list
Specifies an array of pointers to character strings that identify the .uid files.
ancillary_structures_list
A list of operating system-dependent ancillary structures corresponding to such things as file names, clobber flag, and so forth.
This argument should be NULL for most operations. If you need to reference this structure, see the definition of IDBOSOpen-
ParamPtr in DwtAppl.h for more information.
hierarchy_id_return
Returns the search hierarchy ID. The search hierarchy ID identifies the list of .uid files that DRM will search (in order) when
performing subsequent fetch calls.
Description
The DwtOpenHierarchy function allows the user to specify the list of UID files that DRM will search in subsequent fetch operations. All
subsequent fetch operations will return the first occurrence of the named item encountered while traversing the UID hierarchy from the
first list element (UID file specification) to the last list element. This function also allocates a hierarchy ID and opens all the UID
files in the hierarchy. It initializes the optimized search lists in the hierarchy. If DwtOpenHierarchy encounters any errors during its
execution, any files that were opened are closed.
Each UID file specified in file_names_list can specify either a full directory pathname or a file name. If a UID file does not specify the
pathname it will not contain any embedded slashes (/), and it will be accessed through the UIDPATH environment variable.
The UIDPATH environment variable specifies search paths and naming conventions associated with UID files. It can contain the substitution
fields %L and %N, where the current setting of the LANG environment variable is substituted for %L and the .uid name passed to DwtOpenHier-
archy is substituted for %N. For example, the following UID path and DwtOpenHierarchy call would cause DRM to open two separate .uid
files:
UIDPATH=/uidlib/%L/%N.uid:/uidlib/%N/%L
static char *uid_files[] = {"/usr/users/me/test.uid", "test2"};
DRMHierarchy *Hierarchy_id;
DwtOpenHierarchy((DRMCount)2,uid_files, NULL, Hierarchy_id)
The first file, /usr/users/me/test.uid, would be opened as specified, as this file specification includes a pathname. The second file,
test2, would be looked for first in /uidlib/$LANG/test2.uid, and second in /uidlib/test2/$LANG.
After DwtOpenHierarchy opens the UID hierarchy, you should not delete or modify the UID files until you close the UID hierarchy by calling
DwtCloseHierarchy.
Return Values
This function returns one of these status return constants:
DRMSuccess The function executed
successfully.
DRMNotFound File not found.
DRMFailure The function failed.
See Also
DwtCloseHierarchy(3Dwt)
DwtOpenHierarchy(3Dwt)