--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
WD HDD Ultrastar DC HC520 HUH721212AL4205 12TB 3.5" SAS Server Hard Disk Drive
$45.36
Seagate Exos 7E10 ST2000NM000B 2TB 7200RPM SATA 6.0Gb/s 3.5" Internal Hard Drive
$29.99
WD 16TB Elements Desktop, Certified Refurbished Hard Drive - RWDBWLG0160HBK-NESN
$209.99
Seagate ST8000NM0055 8TB 7200RPM 256MB SATA 6.0 Gb/s 3.5" Enterprise Hard Drive
$44.63
HGST Ultrastar DC HC520 12TB SATA 6Gb 256MB 3.5" Enterprise HDD- HUH721212ALE601
$82.99
HP 4TB 3.5" 12Gb/s 7.2K SAS Hard Drive P/N: 793674-001 / 803634-001 / 695597-004
$13.99
HGST Ultrastar HE10 HUH721010ALE600 10TB SATA 6Gb/s 7200RPM 3.5" Enterprise HDD
$78.99
1TB HDD/SSD 2.5" SATA Hard Drive for Laptop with Win 10/Win 11 Pro Pre-installed
$18.99
HDD 3.5" SATA Hard Drive with Windows 7/Win 10 Installed Legacy
$35.99
Seagate Exos X14 12TB SATA6Gb/s 7200RPM 3.5" Enterprise Hard Drive ST12000NM0558
$109.95