![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
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 |
| Read value from particular position in file. | krishnarao | Shell Programming and Scripting | 2 | 05-15-2008 06:49 AM |
| read space filled file and replace text at specific position | COD | Shell Programming and Scripting | 6 | 04-21-2008 05:40 AM |
| How to read the configuration file from shell script | nishanth hampal | Shell Programming and Scripting | 7 | 02-27-2008 03:42 AM |
| Korn Shell Script - Read File & Search On Values | run_unx_novice | Shell Programming and Scripting | 2 | 06-15-2005 07:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
Is it we can read or search the item in a file sequentially by the position using unix shell script..??The position i means is: for example.. inside the xxx file, it contain with: ---------------------------------------------------------------------- 1200120136420 1210324120 12145123 1200120136420 1210324120 22178210 ---------------------------------------------------------------------- position: 12345678901234567890123 4 Then i wanna grep or search for value in position 24 = 0. like that.. position is count space by space or character or alphanumeric length.. ![]() |
|
|||||
|
Quote:
Code:
while read file1line
do
while read file2line
do
echo "$file1line $file2line"
break 1
done < file2
done < file1
|
|
||||
|
Quote:
I had try this : # item=10023 awk 'substr($0,24,1)=="$item" ' filename # but it cannot work. the system will take the $item as a string directly. |
![]() |
| Bookmarks |
| Tags |
| grep or |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|