Search Results

Search: Posts Made By: gsam
1,480
Posted By Yoda
No need for a while loop to read line by line....
No need for a while loop to read line by line. You can achieve this by using below awk code:
awk 'substr($0,11,1)=="Y"' input > output
1,480
Posted By joeyg
Perhaps a simpler approach?
$ cat sample31.txt
DTLDETAIL1YAPPLE
DTLDETAIL2YBALL
DTLDETAIL3NCAT
DTLDETAIL4NDOG
DTLDETAIL5YFISH

$ awk '{if (substr($0,11,1)=="Y") print $0}' <sample31.txt
DTLDETAIL1YAPPLE
DTLDETAIL2YBALL...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 02:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy