Hi John,
On Monday 07 Feb 2011 16:18:32 John Delacour wrote:
> At 14:22 +0200 07/02/2011, Shlomi Fish wrote:
> >Hi John,
> >
> >a few comments on your code.
> >
> >
> >Actually, see perldoc perlrun - http://perldoc.perl.org/perlrun.html - by
> >giving -p and -i (untested) you can replace the conte
At 14:22 +0200 07/02/2011, Shlomi Fish wrote:
Hi John,
a few comments on your code.
Actually, see perldoc perlrun - http://perldoc.perl.org/perlrun.html - by
giving -p and -i (untested) you can replace the contents of a file "in-place".
untested?! Why don't you test it before recommending
Hi John,
a few comments on your code.
On Monday 07 Feb 2011 13:50:57 John Delacour wrote:
> At 07:11 -0800 05/02/2011, zavierz wrote:
> >Here's code which was suggested to me, but when I execute it I'm
> >returned to the command line and nothing happens:
> >
> >#!/usr/bin/perl
> >s/^(Article\s+[0
At 07:11 -0800 05/02/2011, zavierz wrote:
Here's code which was suggested to me, but when I execute it I'm
returned to the command line and nothing happens:
#!/usr/bin/perl
s/^(Article\s+[0-9]+\s+\N*\S)/\\subsection*{$1}/gm
I called this script "Article" and saved it as article.pl
The usa
On 05/02/2011 15:11, zavierz wrote:
Hi, I am trying to modify a LaTex file which is plain text.
The file contains lines similar to the following, but each line is
followed by text, so that:
Article 1 Cats
Article 2 Dogs
Article 3 Fish
Article 4 Ferrets
etc.
I would like to modify the file
On Feb 5, 7:11 am, zavi...@gmail.com (zavierz) wrote:
> Hi, I am trying to modify a LaTex file which is plain text.
> The file contains lines similar to the following, but each line is
> followed by text, so that:
>
> Article 1 Cats
> Article 2 Dogs
> Article 3 Fish
> Article 4 Ferrets
>
> etc.
On 2011-02-06 16:52, mani kandan wrote:
$I=~s/^(Article\s+[0-9]+\s+[\A-Z_a-z]+\S)/\\subsection*{$1}/g;
print "$I";
That is weird advice in many ways:
1. A variable $I, what is it? Why capital?
2. No spaces around '=~', why?
3. You took out the m-modifier, why? (now it will only match (and
On 2011-02-05 16:11, zavierz wrote:
s/^(Article\s+[0-9]+\s+\N*\S)/\\subsection*{$1}/gm
Simplified:
s/^( Article \s+ [0-9]+ .* \S )
/\\subsection*{$1}/gmx;
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://l
Dear zavierz
probably you can try this
$I=~s/^(Article\s+[0-9]+\s+[\A-Z_a-z]+\S)/\\subsection*{$1}/g;
print "$I";
--- On Sat, 5/2/11, zavierz wrote:
From: zavierz
Subject: Text Manipulation
To: beginners@perl.org
Date: Saturday, 5 February, 2011, 8:41 PM
Hi, I am trying to modify a LaTex file
Per Larsson am Dienstag, 9. Mai 2006 17.50:
> Thank you, that solved the problem, but only partly I'm afraid. Problem
> is that the lines need to be formatted in a certain way, so that one
> line looks exactly like this:
> ATOM 1 N ALA 1 41.744 64.901 30.842 1.00 47.38
> 2CDV 8
Thank you, that solved the problem, but only partly I'm afraid. Problem
is that the lines need to be formatted in a certain way, so that one
line looks exactly like this:
ATOM 1 N ALA 1 41.744 64.901 30.842 1.00 47.38
2CDV 83
Is there a way to combine the code below w
On 5/9/06, Per Larsson <[EMAIL PROTECTED]> wrote:
snip
ie. get everything that is sitting between two ATOM-identifiers to occur
on the same line. How can I achieve this?
As always, TMTOWTDI:
You can set the input record separator
use strict;
use warnings;
{
local $/ = 'ATOM\n';
<>; #throw awa
Patricia E Gorden-Ozgul wrote:
>
> I need to construct a working printf statement where each field in a given
> record would print at a specified position.
>
> Each record may or may not contain any particular field but will always
> begin with .VENDOR.LIBRARY. and end with .VENDOR.XINFO.END.
>
Patricia E Gorden-Ozgul wrote:
> I need to construct a working printf statement where each field in a
> given record would print at a specified position.
Hi Pat.
I've been amusing myself with your problem for an hour or so, and
although I don't in general approve of handing out ready-made
solutio
Gorden-Ozgul, Patricia E wrote:
> I need to construct a working printf statement where each field in a
> given record
> would print at a specified position.
>
> Each record may or may not contain any particular field but will
> always begin with .VENDOR.LIBRARY. and end with .VENDOR.XINFO.END.
>
On Thursday, May 30, 2002, at 01:13 , Jakob Kofoed wrote:
> format STDOUT =
> @>> @> @> @> @> @>>
> $$a,$b,$c,$d,$e,$f
well ok, so to cheat I had to do
perldoc -f write
perldoc -f format
since I have not done this in so long
Jakob Kofoed wrote at Thu, 30 May 2002 22:13:42 +0200:
Sorry, I don't know enough of the format command to help.
But that seems to be a little bit long.
> print "Enter Path DATA file .. \n";
> chop($file = );
>
> print " \n";
> print "Enter DATA1 ... ";
> chop($data1 = );
>
> p
17 matches
Mail list logo