Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extracting from pipe delimited file. Post 302288334 by Yogesh Sawant on Tuesday 17th of February 2009 02:55:06 AM
Old 02-17-2009
if you want to compare performance difference of two codes (between split and regular expressions), CPAN module Devel::DProf would be helpful for you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to split pipe delimited file

I have a pipe delimited input file as below. First byte of the each line indicate the record type. Then i need to split the file based on record_type = null,0,1,2,6 and create 5 files. How do i do this in a ksh script? Pls help |sl||SL|SL|SL|1996/04/03|1988/09/15|C|A|sl||||*|... (4 Replies)
Discussion started by: njgirl
4 Replies

2. Shell Programming and Scripting

How to generate a pipe ( | ) delimited file?

:)Hi Friends, I have certain log files extracted. I want it to be converted in pipe ( | ) delimited file. How do i do it? E.g. Account Balance : 123456789 Rs O/P (Account Balance: | 123456789 Rs) Account Balance (Last) > 987654321 Rs O/P (Account Balance (Last) | 987654321 Rs) Last... (5 Replies)
Discussion started by: anushree.a
5 Replies

3. Shell Programming and Scripting

convert a pipe delimited file to a':" delimited file

i have a file whose data is like this:: osr_pe_assign|-120|wg000d@att.com|4| osr_evt|-21|wg000d@att.com|4| pe_avail|-21|wg000d@att.com|4| osr_svt|-11|wg000d@att.com|4| pe_mop|-13|wg000d@att.com|4| instar_ready|-35|wg000d@att.com|4| nsdnet_ready|-90|wg000d@att.com|4|... (6 Replies)
Discussion started by: priyanka3006
6 Replies

4. UNIX for Dummies Questions & Answers

Delete last value from pipe delimited file

I have a large(ish) pipe delimited file. The last line of the file contains a total row count and a checksum: END|1537451|1328569446 After making other adjustments to the file, I need to strip out the checksum and apply a new value - I have a script to generate the checksum and 'cat' it... (3 Replies)
Discussion started by: relentl3ss
3 Replies

5. Shell Programming and Scripting

How to convert a space delimited file into a pipe delimited file using shellscript?

Hi All, I have space delimited file similar to the one as shown below.. I need to convert it as a pipe delimited, the values inside the pipe delimited file should be as highlighted... AA ATIU2345098809 009697 005374 BB ATIU2345097809 005445 006518 CC ATIU9685098809 003215 003571 DD... (7 Replies)
Discussion started by: nithins007
7 Replies

6. UNIX for Dummies Questions & Answers

Reading a pipe delimited file

Hi Guys, i am reading a pipe delimited file using awk command. I have tested the gawk separately. it was fine. But when i execute the script. i am getting the following error saying command not found. Can somebody point out as what i am doing wrong. Cheers!!! (3 Replies)
Discussion started by: mac4rfree
3 Replies

7. UNIX for Advanced & Expert Users

Check Whether File is Pipe Delimited

Can anybody help me how to check whether a file is Pipe delimited or not? (1 Reply)
Discussion started by: Allwin333
1 Replies

8. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

9. Shell Programming and Scripting

How to ignore Pipe in Pipe delimited file?

Hi guys, I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file for eg: file 1: xx|yy|"xyz|zzz"|zzz|12... using below awk command awk 'BEGIN {FS=OFS="|" } print $3 i would get xyz But i want as : xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies

10. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
DPROFPP(1)						 Perl Programmers Reference Guide						DPROFPP(1)

NAME
dprofpp - display perl profile data SYNOPSIS
dprofpp [-a|-z|-l|-v|-U] [-d] [-s|-r|-u] [-q] [-F] [-I|-E] [-O cnt] [-A] [-R] [-S] [-g subroutine] [-G <regexp> [-P]] [-f <regexp>] [profile] dprofpp -T [-F] [-g subroutine] [profile] dprofpp -t [-F] [-g subroutine] [profile] dprofpp -G <regexp> [-P] [profile] dprofpp -p script [-Q] [other opts] dprofpp -V [profile] DESCRIPTION
The dprofpp command interprets profile data produced by a profiler, such as the Devel::DProf profiler. Dprofpp will read the file tmon.out and display the 15 subroutines which are using the most time. By default the times for each subroutine are given exclusive of the times of their child subroutines. To profile a Perl script run the perl interpreter with the -d switch. So to profile script test.pl with Devel::DProf use the following: $ perl5 -d:DProf test.pl Then run dprofpp to analyze the profile. The output of dprofpp depends on the flags to the program and the version of Perl you're using. $ dprofpp -u Total Elapsed Time = 1.67 Seconds User Time = 0.61 Seconds Exclusive Times %Time Seconds #Calls sec/call Name 52.4 0.320 2 0.1600 main::foo 45.9 0.280 200 0.0014 main::bar 0.00 0.000 1 0.0000 DynaLoader::import 0.00 0.000 1 0.0000 main::baz The dprofpp tool can also run the profiler before analyzing the profile data. The above two commands can be executed with one dprofpp command. $ dprofpp -u -p test.pl Consult "PROFILE FORMAT" in Devel::DProf for a description of the raw profile. OUTPUT
Columns are: %Time Percentage of time spent in this routine. #Calls Number of calls to this routine. sec/call Average number of seconds per call to this routine. Name Name of routine. CumulS Time (in seconds) spent in this routine and routines called from it. ExclSec Time (in seconds) spent in this routine (not including those called from it). Csec/c Average time (in seconds) spent in each call of this routine (including those called from it). OPTIONS
-a Sort alphabetically by subroutine names. -d Reverse whatever sort is used -A Count timing for autoloaded subroutine as timing for *::AUTOLOAD. Otherwise the time to autoload it is counted as time of the subroutine itself (there is no way to separate autoload time from run time). This is going to be irrelevant with newer Perls. They will inform "Devel::DProf" when the "AUTOLOAD" switches to actual subroutine, so a separate statistics for "AUTOLOAD" will be collected no matter whether this option is set. -R Count anonymous subroutines defined in the same package separately. -E (default) Display all subroutine times exclusive of child subroutine times. -F Force the generation of fake exit timestamps if dprofpp reports that the profile is garbled. This is only useful if dprofpp determines that the profile is garbled due to missing exit timestamps. You're on your own if you do this. Consult the BUGS section. -I Display all subroutine times inclusive of child subroutine times. -l Sort by number of calls to the subroutines. This may help identify candidates for inlining. -O cnt Show only cnt subroutines. The default is 15. -p script Tells dprofpp that it should profile the given script and then interpret its profile data. See -Q. -Q Used with -p to tell dprofpp to quit after profiling the script, without interpreting the data. -q Do not display column headers. -r Display elapsed real times rather than user+system times. -s Display system times rather than user+system times. -T Display subroutine call tree to stdout. Subroutine statistics are not displayed. -t Display subroutine call tree to stdout. Subroutine statistics are not displayed. When a function is called multiple consecutive times at the same calling level then it is displayed once with a repeat count. -S Display merged subroutine call tree to stdout. Statistics are displayed for each branch of the tree. When a function is called multiple (not necessarily consecutive) times in the same branch then all these calls go into one branch of the next level. A repeat count is output together with combined inclusive, exclusive and kids time. Branches are sorted with regard to inclusive time. -U Do not sort. Display in the order found in the raw profile. -u Display user times rather than user+system times. -V Print dprofpp's version number and exit. If a raw profile is found then its XS_VERSION variable will be displayed, too. -v Sort by average time spent in subroutines during each call. This may help identify candidates for inlining. -z (default) Sort by amount of user+system time used. The first few lines should show you which subroutines are using the most time. -g "subroutine" Ignore subroutines except "subroutine" and whatever is called from it. -G <regexp> Aggregate "Group" all calls matching the pattern together. For example this can be used to group all calls of a set of packages -G "(package1::)|(package2::)|(package3::)" or to group subroutines by name: -G "getNum" -P Used with -G to aggregate "Pull" together all calls that did not match -G. -f <regexp> Filter all calls matching the pattern. -h Display brief help and exit. -H Display long help and exit. ENVIRONMENT
The environment variable DPROFPP_OPTS can be set to a string containing options for dprofpp. You might use this if you prefer -I over -E or if you want -F on all the time. This was added fairly lazily, so there are some undesirable side effects. Options on the commandline should override options in DPROFPP_OPTS--but don't count on that in this version. BUGS
Applications which call _exit() or exec() from within a subroutine will leave an incomplete profile. See the -F option. Any bugs in Devel::DProf, or any profiler generating the profile data, could be visible here. See "BUGS" in Devel::DProf. Mail bug reports and feature requests to the perl5-porters mailing list at <perl5-porters@perl.org>. Bug reports should include the output of the -V option. FILES
dprofpp - profile processor tmon.out - raw profile SEE ALSO
perl, Devel::DProf, times(2) perl v5.12.1 2010-07-01 DPROFPP(1)
All times are GMT -4. The time now is 09:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy