large-files

Large file transfer over java socket [duplicate]

半世苍凉 提交于 2019-12-09 19:14:15
问题 This question already has answers here : Java multiple file transfer over socket (2 answers) Closed 2 years ago . I have written a small client-server code for transferring small file. It uses Data output stream and readFully() method of data input stream. This code does not work for larger files for obvious reasons. I was thinking of fragmenting large files into smaller chunks of 1Kb each before sending them to client. But I can't think of any solution (like how to write multiple chunks on

ASP.NET C# OutofMemoryException On Large File Upload

自古美人都是妖i 提交于 2019-12-09 13:25:05
问题 I have the following file upload handler: public class FileUploader : IHttpHandler { public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; context.Response.ContentType = "text/html"; context.Response.ContentEncoding = System.Text.Encoding.UTF8; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); var tempPath = request.PhysicalApplicationPath + "\\Files\\TempFiles\\"; byte[] buffer = new byte[request.ContentLength]; using (BinaryReader br = new

Multi-line regex search in whole file

落花浮王杯 提交于 2019-12-09 09:56:38
问题 I've found loads of examples on to to replace text in files using regex. However it all boils down to two versions: 1. Iterate over all lines in the file and apply regex to each single line 2. Load the whole file. No. 2 Is not feasible using "my" files - they're about 2GiB... As to No. 1: Currently this is my approach, however I was wondering... What if need to apply a regex spanning more than one line ? 回答1: Here's the Answer: There is no easy way I found a StreamRegex-Class which could be

Allow Multiple Files Upload on Google Apps Script

荒凉一梦 提交于 2019-12-09 03:22:53
问题 Question How do I change this script to allow multiple files to be uploaded or even files bigger than 5 MB? Current script: <!-- Written by Amit Agarwal amit@labnol.org --> <form class="main" id="form" novalidate="novalidate" style="max-width: 480px;margin: 40px auto;"> <div id="forminner"> <div class="row"> <div class="col s12"> <h5 class="center-align teal-text">Submit My Article</h5> <p class="disclaimer">This <a href="http://www.labnol.org/internet/file-upload-google-forms/29170/">File

Good and effective CSV/TSV Reader for Java

ⅰ亾dé卋堺 提交于 2019-12-09 02:49:32
问题 I am trying to read big CSV and TSV (tab-separated) Files with about 1000000 rows or more. Now I tried to read a TSV containing ~2500000 lines with opencsv, but it throws me an java.lang.NullPointerException . It works with smaller TSV Files with ~250000 lines. So I was wondering if there are any other Libraries that support the reading of huge CSV and TSV Files. Do you have any ideas? Everybody who is interested in my Code (I shorten it, so Try-Catch is obviously invalid): InputStreamReader

API for simple File (line count) functions in Java

眉间皱痕 提交于 2019-12-09 00:54:32
问题 Hi : Given an arbitrary file (java), I want to count the lines. This is easy enough, for example, using Apache's FileUtils.readLines(...) method... However, for large files, reading a whole file in place is ludicrous (i.e. just to count lines). One home-grown option : Create BufferedReader or use the FileUtils.lineIterator function, and count the lines. However, I'm assuming there could be a (low memory), up to date API for doing simple large File operations with a minimal amount of boiler

Is there a limit on PHP file_get_contents? [closed]

非 Y 不嫁゛ 提交于 2019-12-08 15:40:07
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I am trying to read a large file (10M) using php file_get_contents $file = 'http://www.remoteserver.com/test.txt'; $data = file_get_contents( $file );

How to solve the java heap space error while loading the large xls file using POI

怎甘沉沦 提交于 2019-12-08 11:31:33
问题 I am trying to load and parse a xls file which is of 11mb and I am using WorkbookFactory.create(myFile)) to load it.But I am not able to load this file and parse it.Can anyone help me out of this this the code I am using in my program , public class LargeExcelManager { private Workbook wb ; public Workbook getWb() { return wb; } public void setWb(Workbook wb) { this.wb = wb; } public LargeExcelManager(String fileName)throws Exception { openWorkbook(fileName); } private void openWorkbook

Handle Large File with PHP

百般思念 提交于 2019-12-08 09:27:22
问题 I have a file with the size of around 10 GB or more. The file contains only numbers ranging from 1 to 10 on each line and nothing else. Now the task is to read the data[numbers] from the file and then sort the numbers in ascending or descending order and create a new file with the sorted numbers. Can anyone of you please help me with the answer? 回答1: I'm assuming this is somekind of homework and goal for this is to sort more data than you can hold in your RAM? Since you only have numbers 1-10

read part of h5 dataset python

时光毁灭记忆、已成空白 提交于 2019-12-08 05:22:48
问题 I'm reading in large sets of data from an .h5 file, (200,000 points per dataset) and I currently don't need all of it so what I've been doing is reading in the data, then truncating it after. Is there a way to only read the first X items of an h5 dataset? 回答1: Use this... import numpy as np import h5py filename = 'file.hdf5' f = h5py.File(filename, 'r') key = list(f.keys())[0] data = list(f[key][1]) Indexing may vary for key and f[key] , where [0] is an arbitrary dataset of file.hdf5 and [1]