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: Fixed length records containing 2 different records types with

Rookie Card wrote:

> Ed -
> awk '{ print substr($0,18,1) }' REC18.txt
> A
> B
> S
> A
>
> Then I try
> awk '{ print "A"==substr($0,18,1) }' REC18.txt
> 0
> 0
> 0
> 0
> This is with the example data: REC18.txt
> 20040911324834736A90028
> CLIENTID000VNI112B92658
> CLIENTID000VNI118S98271
> 20041112534129983A93065
> Thanks
> Gary / Rookie Card
>

Since neither oawk nor nawk would accept that last command, I assume
you're running gawk. Here's what happens when I use gawk version 3.0.4
on Solaris:

PS1> gawk '{ print substr($0,18,1) }' REC18.txt
A
B
S
A
PS1> gawk '{ print "A"==substr($0,18,1) }' REC18.txt
1
0
0
1

Regards,

Ed.

Report this thread to moderator Post Follow-up to this message
Old Post
Ed Morton
01-06-05 08:57 PM


Sponsored Links




Last Thread Next Thread Next
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 07:41 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.