Questions tagged [fixed-length-record]

66 questions
15
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
  • 801
  • 1
  • 12
  • 30
12
votes
5 answers

How do I read fixed-length records in Perl?

What's the best way to read a fixed length record in Perl. I know to read a file like: ABCDE 302 DEFGC 876 I can do while () { $key = substr($_, 0, 5); $value = substr($_, 7, 3); } but isn't there a way to do this with read/unpack?
David Nehme
  • 20,665
  • 7
  • 73
  • 114
10
votes
1 answer

C# - Can FileHelper FieldConverter routines refer to other fields in the record?

I am using the excellent FileHelpers library to process a fixed-length airline schedule file. I have a date field, then a few fields later on in the record, a time field. I want to combine both of these in the FileHelpers record class, and know…
Pete
  • 101
  • 3
8
votes
1 answer

.NET Library For Fixed Length Text Files

I'm looking for a .NET (much preferably open source in C#) library for dealing with fixed length field text files. It wouldn't be too much to write one, but existing, tested work is always nicer, to start with. I will be extracting data in fixed…
ProfK
  • 44,292
  • 106
  • 358
  • 713
7
votes
5 answers

c# fixed length string

I need to generate a text line with a fixed lenght: What I have right now is: StringBuilder _sb = new StringBuilder(); _sb.Append(string.Format("{0,5}", "MM")); // serie to cancel _sb.Append(string.Format("{0,20}", "45444")); // folio to…
VAAA
  • 12,647
  • 20
  • 110
  • 213
6
votes
5 answers

Java fixed-width file format read/write library

I'm looking for a good Java library that easily allows the read/write of fixed-width files. Needed for maintaining legacy systems, i.e. files are needed to work with COBOL. Any suggestions are greatly appreciated! Thanks.
TyC
  • 724
  • 6
  • 10
  • 22
5
votes
2 answers

Limiting the column data width to fixed size in Bootstrap 3

I am using Bootstrap 3 responsive tables for showing the data. However, One of column is having huge data compare to rest of the columns as shown below But I would like to display limited length of description. In short, I would like to display…
Reddy
  • 16,522
  • 43
  • 127
  • 190
4
votes
3 answers

What's a good library for parsing fixed-length records in Groovy?

I want a library that I can give it a file and a config param of column length, name, and possibly type and from that get back a map of the columns of each row. This isn't difficult thing to do on my own, but I would be surprised if there wasn't…
mfollett
  • 1,814
  • 15
  • 27
4
votes
1 answer

Pre-process data file before pandas read_csv

I work with data output from SAP, but it is neither CSV, as it does not quote strings containing its delimiter, nor fixed width as it has multi-byte chars. It is kind of a "fixed width" character-wise. To get it into pandas I currently read the…
mvbentes
  • 926
  • 9
  • 22
4
votes
2 answers

Regex for fixed width field

I need to match a fixed width field on a file layout with a regular expression. The field is numeric/integer, always have four characters and is included in the range of 0..1331. When the number is smaller than 1000, the string is filled with left…
Lailson Bandeira
  • 754
  • 1
  • 7
  • 18
3
votes
2 answers

Is xslt good approach to convert text to xml structure?

I am trying to find a better solution to convert a plain text (but with predefined lengths for each field) to xml. For example the input text can be "Testuser new york 10018", the first 11 characters indicates user name, next 12 character…
testuser
  • 658
  • 10
  • 23
3
votes
1 answer

FileHelpers FieldConverter doesn't get called if value is whitespace

I am trying to parse a file using FileHelpers. I need to map fields to a KeyValuePair and for a few of these fields, there is a mapping if the string in the file is whitespace. However, my custom FieldConverter's FieldToString method does not seem…
bmay2
  • 241
  • 1
  • 4
  • 16
3
votes
2 answers

What is the most simple/elegant way to calculate the length of a number written as text?

Given the maximum possible value, how to simply express the space needed to write such number in decimal form as text ? The real task: logging process ids (pid_t) with fixed length, using gcc on Linux. It'd be good to have a compile time expression…
CsTamas
  • 3,803
  • 5
  • 28
  • 34
2
votes
1 answer

Best practices for fixed-width processing in .NET

I'm working a .NET web service that will be processing a text file with a relatively long, multilevel record format. Each record in the file represents a different entity; the record contains multiple sub-types. (The same record format is currently…
John M Gant
  • 17,902
  • 17
  • 59
  • 82
2
votes
1 answer

stretch div content to the fixed position footer at the bottom of the page

My page consists from 4divs: header at the top, in the middle are menu div and content div, and at the bottom is a footer div. Footer should be fixed at the bottom of the screen. I would like that the content div would be stretched from the header…
javanus
  • 101
  • 4
  • 10
1
2 3 4 5