12-09-2010
Quote:
Originally Posted by
rajsharma
Hi ROHON,
And could u pls describe ur code.I would appreciate that.
Regards,
raj.
You can give a try to the above Awk script i posted!!!
This User Gave Thanks to malcomex999 For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have many text file reports generated by a Information Assurance tool that I need to get into a .CSV format or Excel tab delimited format. I want to use sed or awk to grab all the information in the sample text file below and create column headings:Risk ID, Risk Level, Category, Description, How... (5 Replies)
Discussion started by: Bjoeboo
5 Replies
2. Shell Programming and Scripting
Hi Friends
I am facing some problem in extract the lines between two fixed lines
for examplemy text file look like ...
--------
line 1
line 2
line 3
---------
line 4
line 5
--------
line 6
line 7
line 8
line 9
line 10
---------
now i want the data between "-------" these... (4 Replies)
Discussion started by: sushantnirwan
4 Replies
3. Shell Programming and Scripting
Hello,
I've the follwing text:
gfdgfg
--------------------------------
dfgfdgdfg
fdgfdgfdgdgf
fdgf
------------------------------
f
g
gdgf
a constant string that i know
---------------------------------------------
data I want to have data I want to have
data I want to have data I... (16 Replies)
Discussion started by: eric_
16 Replies
4. Shell Programming and Scripting
Hi,
I'm using AIX(ksh shell).
> cat temp.txt
"a","b",0
"c",bc",0
"a1","b1",0
"cc","cb",1
"cc","b2",1
"bb","bc",2
I want the output as:
"a","b","c","bc","a1","b1"
"cc","cb","cc","b2"
"bb","bc"
I want to combine multiple lines into single line where third column is same.
Is... (1 Reply)
Discussion started by: samuelray
1 Replies
5. Shell Programming and Scripting
I have a Unix file with 200,000 records, and need to remove all records from the file that have the character ‘I' in position 68 (68 bytes from the left). I have searched for similar problems and it appears that it would be possible with sed, awk or perl but I do not know enough about any of these... (7 Replies)
Discussion started by: joddo
7 Replies
6. Shell Programming and Scripting
Hello Friends,
I need to examine a huge CDR file according to a complex (at least for me) condition like below and i couldnt write anything :(
In CDR file there are more than hundreds of fields, I need to print the rows which matches the below condition:
while $13 field of subsequent... (9 Replies)
Discussion started by: EAGL€
9 Replies
7. Shell Programming and Scripting
Greetings!
I have been trying to find out a way to take a CSV file with a large number of rows, and a very large number of columns (in the thousands) and convert the rows to a single column of data, where the first row is a header representing the attribute name and the subsequent series of... (3 Replies)
Discussion started by: tntelle
3 Replies
8. Shell Programming and Scripting
Hi All,
I have one file with two columns separated by tab.
I need to search for second column value of this file in the 5 column of another file. If the match is found replace the 5th column of second file with entire row of the first file.
e.g.
file1
123 D.abc
234 D.rde
4563 ... (2 Replies)
Discussion started by: alok2082
2 Replies
9. Shell Programming and Scripting
Hello All,
I have data like this in a column.
0
1
2
3
0
3
4
5
6
0
1
2
3
etc. where 0 identifies the start of a pattern in my data.
So I need the output like below using either awk/sed.
0 1 (2 Replies)
Discussion started by: ks_reddy
2 Replies
10. Shell Programming and Scripting
Hello Friends!
I would like to help the masters ... I have a file with the entry below and would like a script for that output:
Input file:
001 1 01-20152142711532-24S 1637909825/05/2015BAHIA SERVICOS R F, ... (1 Reply)
Discussion started by: He2
1 Replies
LEARN ABOUT DEBIAN
perl::critic::policy::inputoutput::prohibittwoargopen
Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen(3pUser Contributed Perl DocumentatPerl::Critic::Policy::InputOutput::ProhibitTwoArgOpen(3pm)
NAME
Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen - Write "open $fh, q{<}, $filename;" instead of "open $fh, "<$filename";".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
The three-argument form of "open" (introduced in Perl 5.6) prevents subtle bugs that occur when the filename starts with funny characters
like '>' or '<'. The IO::File module provides a nice object-oriented interface to filehandles, which I think is more elegant anyway.
open( $fh, '>output.txt' ); # not ok
open( $fh, q{>}, 'output.txt' ); # ok
use IO::File;
my $fh = IO::File->new( 'output.txt', q{>} ); # even better!
It's also more explicitly clear to define the input mode of the file, as in the difference between these two:
open( $fh, 'foo.txt' ); # BAD: Reader must think what default mode is
open( $fh, '<', 'foo.txt' ); # GOOD: Reader can see open mode
This policy will not complain if the file explicitly states that it is compatible with a version of perl prior to 5.6 via an include
statement, e.g. by having "require 5.005" in it.
CONFIGURATION
This Policy is not configurable except for the standard options.
NOTES
There are two cases in which you are forced to use the two-argument form of open. When re-opening STDIN, STDOUT, or STDERR, and when doing
a safe pipe open, as described in perlipc.
SEE ALSO
IO::Handle
IO::File
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-06-07 Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen(3pm)