Hi,
I wanted to add specific text to each row in a text file containing three rows. Example:
0 8 7 6 5 5
7 8 9 0 7 9
7 8 9 0 1 2
And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this:
21 0 8 7 6 5 5
7 8... (4 Replies)
Hi,
I have text file which contains lines like :
a/a/a/a/.project
b/b/b/b/b/.project
c/c/c/.project
d/.project
e/e/e/e/.project
i want for all lines the last word .project should be removed and the file should look like :
a/a/a/a/
b/b/b/b/b/
c/c/c/
....
how to proceed... (7 Replies)
All,
I know this is a very naive question but I could not find a way to get this working!
I have a file with values like
input.file
Value1
Value2
server1/mylogin,mypasswd
Value3
Value4
And in my code, I am reading the file line by line and processing it.
#! /bin/ksh... (6 Replies)
Hi,
I know there are lots of threads on replacing text within files, usually using sed or awk. However, I find it hard to adapt examples that I found to my specific case. I am kind of new to UNIX and have hard times learning the syntax either for sed or awk so I would appreciate any help. Here's... (5 Replies)
Say the input was as follows:
Brat 20 x 1000 32rf
Pour 15 p 1621 05pr
Dart 10 z 1111 22xx
My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour"
I currently have this line but it is... (6 Replies)
I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work.
Brief overview:
I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Hi
This is my first post and I'm just a beginner. So please be nice to me.
I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file?
I have tried sed -n 241,241p... (13 Replies)
In the perl below, which does execute, I am having trouble with the else in Rule 3. The digit in f{8} is extracted and used to update f accordinly along with the value in f.
There can be either - * or + before the number that is extracted but the same logic applies, that is if the value is greater... (5 Replies)
I have an input file with
A=xyz
B=pqr
I would want the value in Second Field (xyz or pqr) updated with a value present in Shell Variable based on the value passed in the first field. (A or B )
while read line
do
NEW_VALUE = `some functionality done on $line`
If $line=First Field-... (1 Reply)
In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT SUSE
x500::dn
DN(3) User Contributed Perl Documentation DN(3)NAME
X500::DN - handle X.500 DNs (Distinguished Names), parse and format them
SYNOPSIS
use X500::DN;
my $dn = X500::DN->ParseRFC2253 ('cn=John Doe, o=Acme\, Inc., c=US') or die;
print $dn->getRFC2253String(), "
";
$dn = new X500::DN (new X500::RDN ('c'=>'US'), new X500::RDN ('cn'=>'John Doe'));
my $rdn0 = $dn->getRDN (0);
my $c = $rdn0->getAttributeValue ('c');
NOTE
The RFC 2253 syntax is explicitely backwards in relation to the ASN.1 SEQUENCE.
So the RFC 2253 string "cn=John Doe, c=US" has the same meaning as the X.500 string "c=US, cn=John Doe". The X500::DN objects keep the
RDNs in X.500 order!
DESCRIPTION
This module handles X.500 DNs (Distinguished Names). Currently, it parses DN strings formatted according to RFC 2253 syntax into an
internal format and produces RFC 2253 formatted string from it.
Methods
o $object = new X500::DN (rdn, rdn, ...);
Creates a DN object from zero or more arguments of type X500::RDN.
o $object = X500::DN->ParseRFC2253 ('cn=John Doe, o=Acme\, Inc., c=US');
Creates a DN object from an RFC 2253 formatted DN string notation.
o $object->getRFC2253String();
Returns the DN as a string formatted according to RFC 2253 syntax.
o $object->getOpenSSLString();
Returns the DN as a string formatted suitable for "openssl req -subj" and "openssl ca -subj".
o $object->getX500String();
Returns the DN as a string formatted according to X.500 syntax. NOTE: This is a hack, there is no definition for a X.500 string
syntax!
o $object->hasMultivaluedRDNs();
Returns whether the DN contains multi-valued RDNs.
o $object->getRDN (num);
Returns the DN's RDN at position num as an X500::RDN object. num starts with 0, which will return the first RDN in ASN.1 SEQUENCE
order.
o $object->getRDNs();
Returns the DN's RDNs, a list of objects of type X500::RDN, in ASN.1 SEQUENCE order.
EXPORT
None.
BUGS
o Due to Parse::RecDescent's greedyness, white space after attribute values gets into the parsed value. It might be possible to work
around this.
AUTHOR
Robert Joop <yaph-070708@timesink.de>
COPYRIGHT
Copyright 2002 Robert Joop. All Rights reserved. This program is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
SEE ALSO
X500::RDN, perl.
HISTORY
Early 2002: First idea, discussed on comp.lang.perl.moderated
April 2002: First public release, 0.15
perl v5.12.1 2007-07-08 DN(3)