Sponsored Content
Top Forums Programming Extract part of an archive to a different file Post 302954743 by Tribe on Thursday 10th of September 2015 01:01:58 PM
Old 09-10-2015
I'm not sure I need to show internal code that has nothing to do with it. Basically I think the issue comes from the maximum number of items into a byte array. Say an example program already contains this code:

Code:
byte[] content = new byte[(int) entry.getSize()];

That would mean that the maximum number of elements is the maximum value an integer can achieve, which in Java is 2147483647, so make that bytes. That implies the maximum length of piece to extract can be up to 2 GB approximately. What happens if I want to extract a piece of about 7 GB? Even in the 2GB case, I have no idea if the content is stored into ram memory, which will cause problems on low specs computers.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to extract archive to a specified directory

Hi, I would like to extract the files from an archive which I have copied from a different server which has different file structures to my server. When I do a tar xvf archive_name, I get the error saying the file or directory cannot be found. How do I specify a desginated directory to... (4 Replies)
Discussion started by: john_trinh
4 Replies

2. UNIX for Dummies Questions & Answers

Extract a part of file name

Hi, I want to extract a part of filename and pass it as a parameter to one of the scripts. Could someone help. File name:- NLL_NAM_XXXXX.XXXXXXX_1_1.txt. Here i have to extract only XXXXX.XXXXXXX and the position will be constant. that means that i have to extract some n characters from... (6 Replies)
Discussion started by: dnat
6 Replies

3. UNIX for Dummies Questions & Answers

choose what to extract from tar archive

Hello! I want to extract a choosen directory (and its contents) from a tar archive and i have tried what i believe is every option i could find in the manual. I think i have done it once before, but i don't remeber how. Could anyone please tell me how to do? (2 Replies)
Discussion started by: noratx
2 Replies

4. Shell Programming and Scripting

How to extract certain part of log file?

Hi there, I'm having some problem with UNIX scripting (ksh), perhaps somebody can help me out? For example: ------------ Sample content of my log file (text file): -------------------------------------- File1: .... info_1 ... info_2 ... info_3 ... File2: .... info_1 ... info_2 ...... (10 Replies)
Discussion started by: superHonda123
10 Replies

5. Shell Programming and Scripting

extract part of text file

I need to extract the following lines from this text and put it in different files. From xxxx@gmail.com Thu Jun 10 21:15:46 2010 Return-Path: <xxxxx@gmail.com> X-Original-To: xxx@localhost Delivered-To:xxxx@localhost Received: from ubuntu (localhost ) by ubuntu (Postfix) with ESMTP... (11 Replies)
Discussion started by: waxo
11 Replies

6. Shell Programming and Scripting

Extract part of file

Hello All, I need to extract part of a file into a new file My file is Define schema xxxxxx Insert into table ( a ,b ,c ,d ) values ( 1, 2, 3, (15 Replies)
Discussion started by: nnani
15 Replies

7. Shell Programming and Scripting

Extract the part of sequences from a file

I have a text file, input.fasta contains some protein sequences. input.fasta is shown below. >P02649 MKVLWAALLVTFLAGCQAKVEQAVETEPEPELRQQTEWQSGQRWELALGRFWDYLRWVQT LSEQVQEELLSSQVTQELRALMDETMKELKAYKSELEEQLTPVAEETRARLSKELQAAQA RLGADMEDVCGRLVQYRGEVQAMLGQSTEELRVRLASHLRKLRKRLLRDADDLQKRLAVY... (8 Replies)
Discussion started by: rahim42
8 Replies

8. Shell Programming and Scripting

> dpkg-deb to Extract and Reconstruct a Multipart Archive???

Greetings! Here's one which has been bugging me for a bit ;) As might be known, LibreOffice is available to some of us Linux folk as a large set of debs. Of course, being a curious sort, I'd like to dig in and recreate the original tree which is composed of these assorted archives. So, I... (1 Reply)
Discussion started by: LinQ
1 Replies

9. UNIX for Dummies Questions & Answers

Extract tar archive on remote server in another directory

HI All Please suggest how to untar archive on remote sever. When im trying use regular command without any flags everything is working fine: $( ssh <user>@<server> -n '. ~/.profile >/dev/null 2>&1 ; cd /path_1 ; copiedIVR_name=`ls -tr | tail -1` ; tar xvf $copiedIVR_name ' ) but when im... (9 Replies)
Discussion started by: BACya
9 Replies

10. Shell Programming and Scripting

Extract a part of variable/line content in a file

I have a variable and assigned the following values ***XYZ_201519_20150929140642_20150929140644_211_0_0_211 I need to read this variable from backward and stop read when I get first underscore (_) In this scenario I should get 211 Thanks Kris (3 Replies)
Discussion started by: mkris
3 Replies
GRAPHEME_EXTRACT(3)							 1						       GRAPHEME_EXTRACT(3)

grapheme_extract - Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8.

       Procedural style

SYNOPSIS
string grapheme_extract (string $haystack, int $size, [int $extract_type], [int $start], [int &$next]) DESCRIPTION
Function to extract a sequence of default grapheme clusters from a text buffer, which must be encoded in UTF-8. PARAMETERS
o $haystack - String to search. o $size - Maximum number items - based on the $extract_type - to return. o $extract_type - Defines the type of units referred to by the $size parameter: oGRAPHEME_EXTR_COUNT (default) - $size is the number of default grapheme clusters to extract. oGRAPHEME_EXTR_MAXBYTES - $size is the maximum number of bytes returned. oGRAPHEME_EXTR_MAXCHARS - $size is the maximum number of UTF-8 characters returned. o $start - Starting position in $haystack in bytes - if given, it must be zero or a positive value that is less than or equal to the length of $haystack in bytes. If $start does not point to the first byte of a UTF-8 character, the start position is moved to the next character boundary. o $next - Reference to a value that will be set to the next starting position. When the call returns, this may point to the first byte position past the end of the string. RETURN VALUES
A string starting at offset $start and ending on a default grapheme cluster boundary that conforms to the $size and $extract_type speci- fied. EXAMPLES
Example #1 grapheme_extract(3) example <?php $char_a_ring_nfd = "axCCx8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D" $char_o_diaeresis_nfd = "oxCCx88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D" print urlencode(grapheme_extract( $char_a_ring_nfd . $char_o_diaeresis_nfd, 1, GRAPHEME_EXTR_COUNT, 2)); ?> The above example will output: o%CC%88 SEE ALSO
grapheme_substr(3), Unicode Text Segmentation: Grapheme Cluster Boundaries . PHP Documentation Group GRAPHEME_EXTRACT(3)
All times are GMT -4. The time now is 08:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy