![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read file until certain line position | finalight | Shell Programming and Scripting | 5 | 05-21-2008 03:16 AM |
| How to check a word position in a file ? | tibo | Shell Programming and Scripting | 7 | 01-04-2008 02:20 AM |
| check position of end of line for some specific lines | senthil_is | Shell Programming and Scripting | 1 | 11-09-2007 01:19 AM |
| Spliting the line based on position. | senthil_is | Shell Programming and Scripting | 1 | 09-26-2007 01:32 AM |
| urgent- position to comma seprated file | uni_ajay_r | UNIX for Advanced & Expert Users | 3 | 04-26-2006 01:28 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
check position of end of line for some specific lines
Have to check in a file that the lines starting with 620 and 705
are ending at same posiotin. 82012345 62023232323 70523949558 62023255454 9999 In the above lines, i have to check the lines starting with 620 and 705 are having the length 94. Can anyone help. Immediate response is very much appriciated. |
|
||||
|
check position of end of line for some specific lines
Thankyou very much for your immediate response.
But its giving some syntax error. this is what i used. shouldbe=94 srcFile=$1 awk -v e=$shouldbe '{ /^(620|705)/ if(length($0) != e){print "bad line ", NR} }' $srcFile The error is below ============== syntax error The source line is 1. The error context is { /^(620|705)/ >>> if <<< (length($0) != e){print "bad line ", NR} } awk: The statement cannot be correctly parsed. The source line is 1. Can you please correct it? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|