Questions tagged [flat-file]

A flat-file database model is any system using a single file for storage with one record per line, usually plain-text or text mixed with binary data.

A "flat file" is a plain text or mixed text and binary file which usually contains one record per line or 'physical' record (example on disc or tape). Within such a record, the single fields can be separated by delimiters, e.g. commas, or have a fixed length. In the latter case, padding may be needed to achieve this length. Extra formatting may be needed to avoid delimiter collision. There are no structural relationships between the records.

Typical examples of flat files are /etc/passwd and /etc/group on Unix-like operating systems. Another example of a flat file is a name-and-address list with the fields Name, Address, and Phone Number.

Source: Wikipedia (Flat file database)

830 questions
131
votes
11 answers

Flat file databases

What are the best practices around creating flat file database structures in PHP? A lot of more matured PHP flat file frameworks out there which I attempt to implement SQL-like query syntax which is over the top for my purposes in most cases. (I…
saint_groceon
  • 6,167
  • 5
  • 32
  • 26
74
votes
13 answers

Is it faster to access data from files or a database server?

If I have a static database consisting of folders and files, would access and manipulation be faster than SQL server type databases, considering this would be used in a CGI script? When working with files and folders, what are the tricks to better…
Jeremy Gwa
  • 2,333
  • 7
  • 25
  • 31
49
votes
34 answers

Why do we still program with flat files?

Why are flat text files the state of the art for representing source code? Sure - the preprocessor and compiler need to see a flat file representation of the file, but that's easily created. It seems to me that some form of XML or binary data could…
Matt Cruikshank
  • 2,932
  • 21
  • 24
44
votes
6 answers

escaping tricky string to CSV format

I have to create a CSV file from webservice output and the CSV file uses quoted strings with comma separator. I cannot change the format... So if I have a string it becomes a "string"... If the value has quotes already they are replaced with double…
zam6ak
  • 7,229
  • 11
  • 46
  • 84
29
votes
3 answers

Why doesn't SSIS recognize line feed {LF} row delimiter while importing UTF-8 flat file?

I am trying to import data from a utf-8 encoded flat file into SQL Server 2008 using SSIS. This is what the end of the row data looks like in Notepad++: I have a couple more images showing what the file connection manager looks like: You can see…
K Richard
  • 1,924
  • 2
  • 22
  • 43
29
votes
3 answers

Fastest & most flexible way to chart over 2 million rows of flat file data?

I'm collecting some system data in a flatfile, which has this format: YYYY-MM-DD-HH24:MI:SS DD1 DD2 DD3 DD4 Where DD1-DD4 are four items of data. An example of the file is this: 2011-02-01-13:29:53 16 8 7 68 2011-02-01-13:29:58 13 8 6…
Robin Moffatt
  • 30,382
  • 3
  • 65
  • 92
26
votes
3 answers

Android Performance : Flat file vs SQLite

There are few questions related to this topic on stackoverflow, But I didn't get the proper answer. I have some doubts on performance of flat files, Is it better to use flat files instead of SQLite ? Can anybody have performance statistics ? Or…
Nimit
  • 1,714
  • 3
  • 22
  • 33
22
votes
6 answers

SSIS - Flat file always ANSI never UTF-8 encoded

Have a pretty straight forward SSIS package: OLE DB Source to get data via a view, (all string columns in db table nvarchar or nchar). Derived Column to format existing date and add it on to the dataset, (data type DT_WSTR). Multicast task to…
Neil
  • 2,688
  • 1
  • 23
  • 32
21
votes
9 answers

SSIS mysterious error

I got only these 2 errors when converting flat files to database tables. The dataflow seems to work for other flat files with the same layout so I don't understand where these errors could come from. [Flat File Source [204]] Error: An error…
BigChief
  • 1,413
  • 4
  • 24
  • 37
20
votes
5 answers

EDI Flat File parsing with C#?

Initially I was thinking to use SSIS to parse an EDI file, however I've seen a few manual EDI parsers (field mapping), and would like to use automate this functionality in C#. Example EDI File:
ElHaix
  • 12,846
  • 27
  • 115
  • 203
18
votes
6 answers

getting null values while loading the data from flat files into hive tables

I am getting the null values while loading the data from flat files into hive tables. my tables structure is like this: hive> create table test_hive (id int,value string); and my flat file is like this: input.txt 1 a 2 b 3 c 4 d 5 e 6 …
user1823697
  • 189
  • 1
  • 1
  • 3
17
votes
3 answers

How to import a fixed width flat file into database using SSIS?

Does any one have a tutorial on how to import a fixed width flat file into a database using an SSIS package? I have a flat file containing columns with varying lengths. Column name Width ----------- ----- First name 25 Last name …
OBL
  • 1,347
  • 10
  • 24
  • 45
16
votes
9 answers

Is there an smart way to write a fixed length flat file?

Is there any framework/library to help writing fixed length flat files in java? I want to write a collection of beans/entities into a flat file without worrying with convertions, padding, alignment, fillers, etcs For example, I'd like to parse a…
Mikhas
  • 851
  • 1
  • 12
  • 31
15
votes
3 answers

Fill SQL database from a CSV File

I need to create a database using a CSV file with SSIS. The CSV file includes four columns: I need to use the information of that table to populate the three tables I created in SQL below. I have realized that what I need is to use one column of…
HCavill
  • 161
  • 1
  • 4
15
votes
7 answers

Is there a standard format for describing a flat file?

Is there a standard or open format which can be used to describe the formating of a flat file. My company integrates many different customer file formats. With an XML file it's easy to get or create an XSD to describe the XML file format. I'm…
Stimy
  • 1,491
  • 3
  • 15
  • 36
1
2 3
55 56