-
Senior Member
registered user
unix command expert here ?
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.
-
Senior Member
registered user
Re: unix command expert here ?
--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.
-
Senior Member
registered user
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.
-
Senior Member
registered user
--Cool. If you could post your code, it might be of help to others...

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.
-
Senior Member
registered user
perl -e '$/="---unique seperator---";$i=0; while (<>) { print $_ if ($i++);}' combined_file
Similar Threads
-
By jimbob in forum General Support
Replies: 3
Last Post: 06-17-2005, 10:01 AM
-
By Simon_Haddad in forum Hdd Install / Debian / Apt
Replies: 5
Last Post: 04-10-2004, 11:05 PM
-
By garyng in forum General Support
Replies: 0
Last Post: 06-12-2003, 08:38 AM
-
By ndd in forum General Support
Replies: 3
Last Post: 03-22-2003, 02:42 AM
-
By g-ahmadi in forum The Lounge
Replies: 1
Last Post: 03-21-2003, 12:16 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

WAVLINK RAID 2 Bay Hard Drive Docking Station SATA 2.5/3.5'' SSD HDD Enclosure
$107.99

Broadcom 9600-24i Tri-Mode RAID Controller 4.0 NVMe SAS SATA NEW 05-50111-01003
$639.69

Intel VROC Premium RAID Controller Card PCIe Add-On Module VROCPREMMOD
$265.00

Lacie 2big Quadra RAID 2 x 2 TB 4 TB Only 158 hours
$199.00

2-Bay/4-Bay Hard Drive Enclosure for 3.5"/2.5'' SATA HDD/SSD 10Gbps USB-C 3.2
$75.99

Lot Mini SAS SFF-8643 To 4 SATA 7pin Hard Disk 6Gbps Data Server Raid Cable 1M
$870.00

Broadcom LSI 9305-16i 12Gbps SAS-3 PCIe x8 HBA 16-Ports Raid Controller
$64.99

PCI to 4 Ports SATA Controller RAID CARD Pci sata Sil3114 Supports 3TBx4 HDD
$18.90

LSI 9461-16i MEGARAID RAID 12GBPS 16 PCIE3.0 PORT KIT W/BATTERY 03-50011-69004
$145.99

Broadcom 9600-24i RAID Controller PCIe Gen 4.1 Tri-Mode NEW 05-50111-01004
$649.99