--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

Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot
$100.00
Netac 2TB 1TB 512GB 256GB Internal SSD 2.5inch SATAIII Solid State Drive lot
$129.99
Western Digital Blue 3D NAND 500GB Internal 2.5" SSD - WDS500G2B0A
$49.99
Samsung 860 EVO 250GB SSD MZ-76E250 2.5" SATA III Solid State Drive -
$36.99
Fanxiang 256GB 512GB 1TB 2TB 4TB SSD Lot 2.5'' SATA Internal Solid State Drive
$42.99
2 PACK 128 GB SSD M.2 2280 SATA Solid State Drive Major Brands, Samsung, LiteON
$28.00
Fanxiang 1/2/5/10Pcs 2.5'' SATA SSD Lot 1TB 2TB 4TB 512GB 256GB TLC Internal SSD
$129.99
Crucial MX500 250GB 2.5" SATA III SSD - Preowned
$29.00
Intel Solid-State Drive DC S3500 Series 240GB Internal 2.5" (SSDSC2BB240G4P) SSD
$29.99
Netac 120GB 256GB 1TB 2TB Internal SSD 2.5'' SATAIII 6Gb/s Solid State Drive lot
$75.99