The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
read space filled file and replace text at specific position COD Shell Programming and Scripting 6 04-21-2008 05:40 AM
How to check a word position in a file ? tibo Shell Programming and Scripting 7 01-04-2008 02:20 AM
How to insert at a particular position in flat file akdwivedi Shell Programming and Scripting 10 08-07-2007 08:47 PM
read or search the item in a file sequentially by position using unix shell script? lok UNIX for Dummies Questions & Answers 6 07-12-2006 06:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2008
krishnarao krishnarao is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 4
Read value from particular position in file.

From unix script i want to read string value in a file from position 2 to 5. which command can be used or any alternatives there??
  #2 (permalink)  
Old 05-15-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
This reads byte position 2-5 on every line of a file
Code:
cut -c2-5 filename

Last edited by jim mcnamara; 05-15-2008 at 06:51 AM..
  #3 (permalink)  
Old 05-15-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Code:
dd if=file skip=1 bs=1 count=4
Only half kidding ...
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0