Questions tagged [fixed-width]

Fixed layouts are layouts that start with a specific size, determined by the Web designer. They remain that width, regardless of the size of the browser window viewing the page. Fixed width layouts allow a designer more direct control over how the page will look in most situations. They are often preferred by designers with a print background, as they allow the designer to make minute adjustments to the layout and have them remain consistent across browsers and computers.

source: http://webdesign.about.com/od/layout/g/bldeffixedlyot.htm

Fixed Width Text File Definition: Above all, a fixed width text file is a file that has a specific format which allows for the saving of textual information/data in an organized fashion. Fixed width text files are special cases of text files where the format is specified by column widths, pad character and left/right alignment. Column widths are in units of characters. So if you have data in a text file where the first column always has exactly 10 characters, and the second column has exactly 5, the third has exactly 12 (and so on), then you have a fixed width text file.

Each row (paragraph) contains one record of information; each record can contain multiple pieces of data (fields), each data field (column) has a precise number of characters. The data is padded with spaces (or any character you specify) if it does not completely use all the characters allotted to it. Further, each piece of data can be left or right justified, meaning the padding of characters can occur on either side.

source: http://www.softinterface.com/Convert-XLS%5CFeatures%5CFixed-Width-Text-File-Definition.htm

462 questions
0
votes
0 answers

R: how to print out the bad line number during parsing

I have a fixed width file that I am reading in this way: library(readr) mydata <- read.fwf(file="myfile.txt", widths = c(12, 7, etc)) It returns: Error in substring(x, first, last) : invalid multibyte string at 'S ' As the file is pretty…
Randomize
  • 8,651
  • 18
  • 78
  • 133
0
votes
1 answer

Windows Batch script * (star) read as text?

I'm writing a batch script to convert a fixed-width text file to .csv format. Here's what I've written so far: @echo off setlocal enabledelayedexpansion for /F "tokens=*" %%A in (HRV*.txt) do ( set var=%%A set mer=!var:~6,11! set…
bweber13
  • 360
  • 4
  • 13
0
votes
0 answers

Skip variables while reading in a fixed width text file in R using readr package

I'm reading in some text files in R using the readr package because of the files fixed width but on some of the files I get the error that cannot allocate vector of size.... I'm assuming some files are too big but I actually don't really need all…
User23
  • 153
  • 2
  • 13
0
votes
1 answer

R readr::read_fwf ignore characters using fwf_widths

I would like to know if there is an easy way to skip characters using the read_fwf from the readr package in R. For example, modifying one of the examples in the documentation library(readr) fwf_sample <- system.file("extdata/fwf-sample.txt",…
lucacerone
  • 9,859
  • 13
  • 52
  • 80
0
votes
1 answer

How do I map a complex object to DataWeave fixed width format

I have a JSON Object { "collection": [ { "field1": "1111", "field2": "1122" }, { "field1": "2211", "field2": "2222" } ], "otherObject": { "otherField": "3333" } } I…
alaeddine.nasri
  • 182
  • 1
  • 2
  • 11
0
votes
4 answers

Left-pad a floating point number without losing trailing zeros after decimal point

I am attempting to write out to a fixed format text file and am having some trouble formatting the numbers properly. It needs to be padded with leading zeros and an implied decimal. Example: 43.80 The output would need to be: 0000004380 So far, I…
Joel S.
  • 105
  • 2
  • 6
0
votes
0 answers

XML Metatags with Fixed width format

As part of Siebel integration with an external system, have a requirement with XML used with Fixed width format. Requirement is to have a XML message in SOAP Format in UTF-8 format for header/Sender details & Auth details. But the main…
DKG
  • 1
  • 1
0
votes
2 answers

Fixed width flat file column addition via Excel or Notepad++

I have a fixed width flat file with n columns. I need to add a new column at the end that is a concatenation of some of the columns. Eg. 0624 11011 LOCA 0624 11031 LOCC 0624 11041 LOCB turns into 0624 11011 LOCA 0624LOCA-ABC 0624 11031…
shashankss
  • 63
  • 3
  • 9
0
votes
1 answer

How to read in a fixed column width file with headers every 3rd row

I have a fixed column width file with headers (that contain important information) every 5th row. Like this: XX ZZ MM 1 12 5 22 9 12 13 11 17 21 2 12 6 22 10 12 14 11 18 21 3 12 7 22 11 12 15 11 19 21 4 12 8 22 12 12 16 11 20 21 AA BB CC 1 12 5 12 9…
user2145867
  • 43
  • 1
  • 3
0
votes
1 answer

Read fixed width text file into datatable row by row - C#

I have a large fixed width text file, I want to read it row by row and insert into a datatable, or just read it into a datatable. how can I assign that from which to which position one column will be? I also have to perform some action like trim the…
0
votes
3 answers

Parsing multi-line fixed-width files

I have a fixed-width flat file. To make matters worse, each line can either be a new record or a subrecord of the line above, identified by the first character on each line: A0020SOME DESCRIPTION MORE DESCRIPTION 922 2321 #…
matiasf
  • 1,098
  • 1
  • 9
  • 17
0
votes
1 answer

Changing fixed width div using media queries in fluid layout

I'm using FlexSlider to display multiple 170px wide logos in a responsive design. Currently the slider fills 100% of the fluid width of the containing div, which is contained in the overall page wrapper, but this frequently leads to half cut off…
0
votes
0 answers

Ragged Right in SSIS does not work properly

Hello: I have an SSIS package that imports a flat text file: the text file is a simple, fixed-width file that’s also CR/LF delimited. This means that: EACH record has a set of fixed length columns (the columns are defined using fixed lengths), but…
LearnByReading
  • 1,813
  • 4
  • 21
  • 43
0
votes
3 answers

Fix the width of html tag

Here is my code snippet-
AlwaysALearner
  • 6,320
  • 15
  • 44
  • 59
0
votes
1 answer

Converting fixed-width txt to tab-delimited txt

I have a fixed-width txt input.txt that looks like 12345 1 23 23 12 2 11 And I have a separate file fixed-width.txt explaining how each column is separated. 1 2 2 3 3 2 4 3 The first column has 2 letters, the 2nd one 3 letters and so on. So I will…
user3123767
  • 1,115
  • 3
  • 13
  • 22