For counting the occurences of specific character in the file
I am issuing the command
grep -o 'character' filename | wc -w
It works in other shells but not in HP-UX as there is no option -o for grep.
What do I do now? (9 Replies)
I'm trying to count the number of 2 specific characters in a very large file. I'd like to avoid using gsub because its taking too long.
I was thinking something like:
awk '-F' { t += NF - 1 } END {print t}' infile > outfile
which isn't working
Any ideas would be great. (3 Replies)
Hi,
I wanted to add a newline character after every 100 characters in a file using a awk or shell without reading each line of the file.
I want to run a command on the complete file.
This does based on a string but i want to add a new line after every 100 characters ir-respective of the... (3 Replies)
Hi,
I need add leading zeroes to a field in a file based on the character count. The field can be of 1 character to 6 character length. I need to make the field 14bytes.
eg:
8351,20,1
8351,234,6
8351,2,0
8351,1234,2
8351,123456,1
8351,12345,2
This should become.
... (3 Replies)
Hi,
I need help regarding counting specific word or character per line and validate it against a specific number i.e 10. And if number of character equals the specific number then that line will be part of the output.
Specific number = 6
Specific word or char = ||
Sample data:... (1 Reply)
i have a reqirement to adjust the data in a file based on a perticular character
the sample data is as below
483PDEAN CORRIGAN 52304037528955WAGES 50000
89BP ABCD MASTER352 5434604223735428 4200
58BP SOUTHERN WA848 ... (1 Reply)
Hello,
:wall:
I have a 12 column csv file. I wish to delete the entire line if column 7 = hello and column 12 = goodbye. I have tried everything that I can find in all of my ref books.
I know this does not work
/^*,*,*,*,*,*,"hello",*,*,*,*,"goodbye"/d
Any ideas?
Thanks
Please... (2 Replies)
Hello,
I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17".
i.e need to get records having exact 17 pipe separated fields(no more or less)
currently i have below :
awk... (1 Reply)
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Discussion started by: teokon90
10 Replies
LEARN ABOUT DEBIAN
devel::calltrace
Devel::CallTrace(3pm) User Contributed Perl Documentation Devel::CallTrace(3pm)NAME
Devel::CallTrace - See what your code's doing
SYNOPSIS
#!/usr/bin/perl -d:CallTrace
package foo;
sub bar {
print "bar
";
baz(); }
sub baz {
print "boo
"; }
foo::bar();
RATIONALE
There are a number of perl modules in the CPAN that are designed to trace a program's execution as it runs. Each uses a different trick to
do its job, but none of them quite met my needs. The technique this module uses is quite simple and seems to be quite robust.
DB::sub
perl will automatically call DB::sub on each subroutine call and leave it up to us to dispatch to where we want to go.
Devel::CallTrace::called
This routine is called with two parameters:
DEPTH
The integer "depth" that this call is being called at.
PARAMS
A reference to the routine's @INC
To get at the subroutine that was being called, have a look at $DB::sub
BUGS
It uses the debugger. How could it not have bugs?
SEE ALSO
perldebguts, DB, a licensed therapist.
trace - Uses source filters. Scares me.
Devel::TraceCalls - Very robust API. The code seems to do all sorts of scary magic
Debug::Trace - Uses symbol table magic to wrap your functions.
Devel::TRaceFuncs - Requires developers to instrument their source files.
COPYRIGHT
Copyright 2005 Jesse Vincent <jesse@bestpractical.com>
This module may be redistributed under the same terms as perl itself
perl v5.10.1 2008-07-07 Devel::CallTrace(3pm)