flat-file

Help With PHP Pagination Script For Flat File Database

こ雲淡風輕ζ 提交于 2019-12-04 23:06:44
I have a few questions regarding a PHP Pagination Script For Flat File Database I found. I have posted the script below. <?php echo '<html><body>'; // Data, normally from a flat file or some other source $data = "Item1|Item2|Item3|Item4|Item5|Item6|Item7|Item8|Item9|Item10"; // Put our data into an array $dataArray = explode('|', $data); // Get the current page $currentPage = trim($_REQUEST[page]); // Pagination settings $perPage = 3; $numPages = ceil(count($dataArray) / $perPage); if(!$currentPage || $currentPage > $numPages) $currentPage = 0; $start = $currentPage * $perPage; $end = (

Using FlatFileItemReader with a TaskExecutor (Thread Safety)

匆匆过客 提交于 2019-12-04 04:20:13
There are a lot of examples which use FlatFileItemReader along with TaskExecutor . I provide samples below (both with XML and Java Config): Using Oracle Coherence with Spring Batch Spring Batch Multithreading Example I have used it my self with XML configuration for large CSVs (GB size) writing to database with the out-of-the-box JpaItemWriter . There seem to be no issues even without setting save-state = false or taking any kind of special handling. Now, FlatFileItemReader is documented as not thread-safe . My guess was that JpaItemWriter was "covering" the issue by persisting Sets i.e.

SSIS Package Cancels instantly on Debug

江枫思渺然 提交于 2019-12-04 04:19:30
问题 I have a rather simple SSIS package that I've used many times to import a tab delimited file into a single table in a database. I attached a new source file to the package and attempted to run the package. The package starts A cmd prompt appears briefly, then disappears [?!] The process then exits, on the Flat File Source component. [??!] Output displays as follows: SSIS package "C:\Users...\Conversion\LoadHistory.dtsx" starting. Information: 0x4004300A at Load Data to Legacy Database - Test,

Is it better for Spark to select from hive or select from file

依然范特西╮ 提交于 2019-12-04 04:08:15
I was just wondering what people's thoughts were on reading from Hive vs reading from a .csv file or a .txt file or an .ORC file, or a .parquet file. Assuming the underlying Hive table is an external table that has the same file format, would you rather read form a Hive table or from the underlying file itself, and why? Mike tl;dr : I would read it straight from the parquet files I am using Spark 1.5.2 and Hive 1.2.1 For a 5Million row X 100 column table some timings I've recorded are val dffile = sqlContext.read.parquet("/path/to/parquets/*.parquet") val dfhive = sqlContext.table("db.table")

Ruby: start reading at arbitrary point in large file

不打扰是莪最后的温柔 提交于 2019-12-03 20:18:01
I have some log files I would like to sift through. The content is exactly what you expect in a log file: many single lines of comma separated text. The files are about 4 gigs each. File.each_line or foreach takes about 20 minutes for one of them. Since a simple foreach seems... simple (and slow), I was thinking that two separate threads might be able to work on the same file if I could only tell them where to start. But based on my (limited) knowledge, I can't decide if this is even possible. Is there a way to start reading the file at an arbitrary line? For lines, it might be a bit difficult

processing text from a non-flat file (to extract information as if it *were* a flat file)

。_饼干妹妹 提交于 2019-12-03 20:09:17
I have a longitudinal data set generated by a computer simulation that can be represented by the following tables ('var' are variables): time subject var1 var2 var3 t1 subjectA ... t2 subjectB ... and subject name subjectA nameA subjectB nameB However, the file generated writes a data file in a format similar to the following: time t1 description subjectA nameA var1 var2 var3 subjectB nameB var1 var2 var3 time t2 description subjectA nameA var1 var2 var3 subjectB nameB var1 var2 var3 ...(and so on) I have been using a (python) script to process this output data into a flat text file so that I

Flat file vs database - speed?

蹲街弑〆低调 提交于 2019-12-03 17:03:11
问题 I'm making a chat program, and I need a place to store messages. The client would contact the server every x seconds with the last received message id, and the server would find all messages with a id higher than that, in the rooms that the client has joined. As I'm not going to store things forever, I'm thinking of using flat files (one per room, as well as direct messages) with only the last 40 or so messages. However I think with comparing numbers a database would be faster. What method of

Simple, fast SQL queries for flat files

倾然丶 夕夏残阳落幕 提交于 2019-12-03 09:59:04
问题 Does anyone know of any tools to provide simple, fast queries of flat files using a SQL-like declarative query language? I'd rather not pay the overhead of loading the file into a DB since the input data is typically thrown out almost immediately after the query is run. Consider the data file, "animals.txt": dog 15 cat 20 dog 10 cat 30 dog 5 cat 40 Suppose I want to extract the highest value for each unique animal. I would like to write something like: cat animals.txt | foo "select $1, max

Simple, fast SQL queries for flat files

笑着哭i 提交于 2019-12-02 23:09:55
Does anyone know of any tools to provide simple, fast queries of flat files using a SQL-like declarative query language? I'd rather not pay the overhead of loading the file into a DB since the input data is typically thrown out almost immediately after the query is run. Consider the data file, "animals.txt": dog 15 cat 20 dog 10 cat 30 dog 5 cat 40 Suppose I want to extract the highest value for each unique animal. I would like to write something like: cat animals.txt | foo "select $1, max(convert($2 using decimal)) group by $1" I can get nearly the same result using sort : cat animals.txt |

Unicode string to flat file from vba

坚强是说给别人听的谎言 提交于 2019-12-01 22:37:00
I want to store a unicode string in a flat file on a windows box from an excel/vba macro. The macro converts normal string to unicode representation, need to store it in a file and retrieve later. As mentioned, you can use the Microsoft Scripting Runtime (scrrun.dll). I have posted some examples below. Some people also like the native file IO features. There is an extensive (and fairly comprehensive thread) thread here: http://www.xtremevbtalk.com/showthread.php?t=123814 However for Unicode files it's probably the least painful to use Textstreams:) Public Sub StringToTextFile(ByVal path As