Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Print fields starting with N to the end of line.
Janis Papanagnou wrote:

> And don't forget initializing z...
>
>      z = ""

Isn't that the default?

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.

Report this thread to moderator Post Follow-up to this message
Old Post
pk
04-01-08 08:59 AM


Re: Print fields starting with N to the end of line.
On 1 Apr., 09:48, pk <p...@pk.invalid> wrote:
> Janis Papanagnou wrote: 
> 
>
> Isn't that the default?

Only initially, but not if you need to reset it for every
input line as in this application context... (see upthread
for the original program)

{  z =3D ""
for (x=3Dnr; x<=3DNF; x++)
z =3D z " " $x
print substr(z, 2)
}


Janis

Report this thread to moderator Post Follow-up to this message
Old Post
Janis
04-01-08 08:59 AM


Re: Print fields starting with N to the end of line.
Janis wrote:

> On 1 Apr., 09:48, pk <p...@pk.invalid> wrote: 
>
> Only initially, but not if you need to reset it for every
> input line as in this application context...

Ok, that was my daily pre-coffee nonsense. :-)

--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.

Report this thread to moderator Post Follow-up to this message
Old Post
pk
04-01-08 08:59 AM


Re: Print fields starting with N to the end of line.

On 3/31/2008 12:56 PM, Janis Papanagnou wrote:
> Janis Papanagnou wrote:
> 
>
>
> And don't forget initializing z...
>
>      z = ""
>
> 

or:

z=$nr
for (x=nr+1; x<=NF; x++)
z = z " " $x
print z

Ed.


Report this thread to moderator Post Follow-up to this message
Old Post
Ed Morton
04-02-08 12:01 AM


Sponsored Links




Last Thread Next Thread Next
Pages (3): « 1 2 [3]
Search this forum -> 
Post New Thread

AWK archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.