--See ' man dd ' (sorry, I haven't done this application myself so all I can do is point.)
See ' man grep ' -- ' grep -b ' will do exactly this.
Originally Posted by garyng
Just want to ask if there is readily available command to 'cut out' a part of a file, say from offset 12345 till end of file ?
another similar problem, any readily available command to 'grep' the first string occurrence in a file and return its offset.
I know I can write a perl script for that but just wondering if there is already something in the standard tool set.
--See ' man dd ' (sorry, I haven't done this application myself so all I can do is point.)
See ' man grep ' -- ' grep -b ' will do exactly this.
Originally Posted by garyng
thanks, the 'grep -b' option only works if the input is considered to be text and in my case it is binary and grep only want to say "match/not match"![]()
Anyway, it seems to be pretty easy in perl so I went that route.
--Cool. If you could post your code, it might be of help to others...
Originally Posted by garyng
perl -e '$/="---unique seperator---";$i=0; while (<>) { print $_ if ($i++);}' combined_file

TP-Link TL-SG105, 5 Port Gigabit Unmanaged Ethernet Switch, Network Hub, Ethern
$15.25
NETGEAR GS308EP Essential Series 8-Port Gigabit PoE+ Unmanaged Switch
$44.99
10-Port Gigabit PoE Network Switch with 8 PoE+ Ports with 2 Combo SFP Slots 125W
$39.99
5Ports Gigabit Network Switch w/ 4 PoE+ Ports Total 52W each port 30W Plug&Play
$31.99
TP-Link TL-SG105 5-Port Gigabit Ethernet Unmanaged Metal Desktop Network Switch
$19.99
5 Port Gigabit Unmanaged Ethernet Switch, Home Network Hub, Office Ethernet S...
$9.64
Arista DCS-7010T-48-R 48P 1GbE 4P 10GbE SFP+ RA Switch with rack mounts
$69.00
TP-Link Omada SG3428 24-Port Gigabit L2+ Managed Switch 4x SFP w/ Ears
$99.99
Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch
$129.99
Extreme Networks 10GE X440-G2-24P-10GE4 16533 24Plus-Ports POE+ Switch UP
$127.00