read parts of binary files by "ranges"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting read parts of binary files by "ranges"
# 1  
Old 08-28-2009
read parts of binary files by "ranges"

i read the "cat" manpages,
but i could not find to tell it like

"read file XY.BIN from byte 1000 to byte 5000"

can somebody please point me into the right direction?

cat would be the ideal tool for my purpose, the way it behaves, but i miss this ranges option.

thanks for any input.
# 2  
Old 08-28-2009
Code:
# cat file1
1234567890

dd skip=3 bs=1 count=5 if=file1 of=file2

# cat file2
45678#

In your case:
skip=999
count=4000
# 3  
Old 08-28-2009
thanks man,

your solution is not really what i need, cause it should be performance optimized, creating a second file is no good choice,

but you brought me to the DD command SmilieSmilieSmilieSmilie

i totally did not think of that one..

big thanks!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extracting Parts of String "#" vs "%"

Hello, I have a question regarding extracting parts of a string and the meaning of # and % in the syntax. I created an example below. # filename=/first/second/third/fourth # # echo $filename /first/second/third/fourth # # echo "${filename##*/}" fourth # # echo "${filename%/*}"... (3 Replies)
Discussion started by: shah9250
3 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

Converting parts of a string to "Hex"

Hi Guys, writing a small shell script, i need to convert parts of a string to "Hex". The problem is that it is not the full string that needs to be converted. I think it's best to show an example: $astring = "xxxxxx ABC+10+##########+DEF xxxx" This is only an example to show how the... (9 Replies)
Discussion started by: HansHansen
9 Replies

4. Shell Programming and Scripting

Read from "list1" and list matches in "list2"

I want to print any matching IP addresse in List1 with List 2; List 1 List of IP addresses; 161.85.58.210 250.57.15.129 217.23.162.249 74.76.129.101 30.221.177.237 3.147.200.59 170.58.142.64 127.65.109.33 150.167.242.146 223.3.20.186 25.181.180.99 2.55.199.32 (3 Replies)
Discussion started by: lewk
3 Replies

5. Shell Programming and Scripting

Purpose of "read" and "$END$" in ksh ?

Hi, Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator? cat $AMS/version|read a b verno d DBVer=$(/usr/bin/printf "%7s" $verno) I checked that the cat $AMS/version command returns following output: ... (10 Replies)
Discussion started by: dbadmin100
10 Replies

6. Shell Programming and Scripting

How do I read several files and track "wc -l" Every 1min X 4 Iterations

I need help with these requirement: I have a FILE1, single column with list of filenames (about 30-150). I need to read each line from FILE1, do a word-count-lines of the filenames and echo a message if word-count-lines is same for 1minute X 4 iterations Example and idea below: FILE1:... (4 Replies)
Discussion started by: olu
4 Replies

7. Shell Programming and Scripting

How to apply a "tolower" AWK to a few parts of a document

Hi people, i have a nice problem to solve.. in an text page i must change all the "*.php" occourences to the respective lowercase.. Example: ... <tr><td> <form action="outputEstrazione.php" method="get"> <table cellspacing='0,5' bgcolor='#000000'><tr><td> <font size='2'... (5 Replies)
Discussion started by: marconet85
5 Replies

8. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

9. Shell Programming and Scripting

Awk - to test multiple files "read" permission ?

Hi Masters, Iam new to this Forum and this is my first post. My question is: I've some datafiles belongs the type (A, B, C) in the location 'export/home/lokiman ' dataA1.txt dataB28.txt dataC35.txt 1) I've to check the read permission for each file, if it not there then I've to... (1 Reply)
Discussion started by: lokiman
1 Replies

10. Shell Programming and Scripting

how to request a "read" or "delivered" receipt for mails

Dears, I've written a script which allows me to send mails in different formats with different attaches. Now I still want to add a feature to this script. My users would like to be able to receive a "read" or "delivered" receipt for their mails. The script send mails on behalve of an specific... (1 Reply)
Discussion started by: plelie2
1 Replies
Login or Register to Ask a Question