UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Technical Term For This 'fixed Width' Format, Not applicable    
 
   
JonSmith
post Mar 15 2019, 04:56 AM
Post#1


UtterAccess VIP
Posts: 4,047
Joined: 19-October 10



Hi guys,

So I have been working with a ooooold file format for a while and I've locally dubbed it a 'terminal file' format. But I should really learn the correct term.
Its basically the style old terminal machines would read (from what I understand) so its a fixed with text file but the fixed widths are not consistent throughout the file, instead the first character in a line determines what the fixed width for that line is.

So for a practical example image this (wrapped in code tags to try and preserve formatting).

CODE
DHelloWorld     100  54
DExample Row    5    10
FUtterAccess             ThisIsAnotherField


The 'D' roles all have a consistent fixed width and the 'F' rows have a different fixed width.
I wrote a generic way to read all these files and extract all the different rows to different files with a schema.ini so they become easy to read so literally nothing to solve here but the correct terminology for this file type!

JS
Go to the top of the page
 
cheekybuddha
post Mar 15 2019, 05:06 AM
Post#2


UtterAccess VIP
Posts: 11,294
Joined: 6-December 03
From: Telegraph Hill


PITA?

--------------------


Regards,

David Marten
Go to the top of the page
 
JonSmith
post Mar 15 2019, 05:08 AM
Post#3


UtterAccess VIP
Posts: 4,047
Joined: 19-October 10



Ah of course David tongue.gif

If no-one actually comes up with the real name I might start using that one and wait for someone to ask what it stands for.

JS
Go to the top of the page
 
Minty
post Mar 15 2019, 05:57 AM
Post#4



Posts: 309
Joined: 5-July 16
From: UK - Wiltshire


It is fixed width. But each data block has it's own specification.

I used to create such monstrosities to export out to a customer of ours back in the late 90's as part of a early "EDI" project

A Data MoreData
A Data MoreData
B DifferentData EvenMoreData GettingBoredDataNow
C 12345 LessData
Go to the top of the page
 
cheekybuddha
post Mar 15 2019, 06:24 AM
Post#5


UtterAccess VIP
Posts: 11,294
Joined: 6-December 03
From: Telegraph Hill


Apologies everyone, I really should have more coffee before I try cracking un[helpful | funny] jokes!

coffee1.gif wary.gif wink.gif

d

--------------------


Regards,

David Marten
Go to the top of the page
 
JonSmith
post Mar 15 2019, 06:25 AM
Post#6


UtterAccess VIP
Posts: 4,047
Joined: 19-October 10



QUOTE
It is fixed width. But each data block has it's own specification.


Yup I know thats what it is, but it should have a special name right?
'Fixed width' suggests it something that its not (a normal fixed width file with only one block).

If it doesn't have a special name I propose we start a Wikipedia page for a PITA file and make it official from now on!
Go to the top of the page
 
Minty
post Mar 15 2019, 06:38 AM
Post#7



Posts: 309
Joined: 5-July 16
From: UK - Wiltshire


Now that you've said that and I've had more coffee, I believe it did have another name.

But I can't for the life of me remember what it was... iconfused.gif

According to here https://support.adeptia.com/hc/en-us/articl...-how-to-map-it-
the format described is fixed width.
Go to the top of the page
 
JonSmith
post Mar 15 2019, 07:27 AM
Post#8


UtterAccess VIP
Posts: 4,047
Joined: 19-October 10



Sure but thats a custom application saying you can 'define' the PITA file.

If you look at
https://docs.microsoft.com/en-us/SQL/odbc/m...SQL-server-2017

This is a more generic Microsoft approach to Text File Driver where you can define a fixed width or comma delimited file and as you can see there is no way to add multiple 'blocks'. This makes me feel like fixed width is still not the right name. The widths aren't fixed per file so it does seem off to call it that.
Of course I could be wrong!
Go to the top of the page
 
cheekybuddha
post Mar 15 2019, 07:38 AM
Post#9


UtterAccess VIP
Posts: 11,294
Joined: 6-December 03
From: Telegraph Hill


These files must come with a spec somewhere to define the mappings of each line type, no?

--------------------


Regards,

David Marten
Go to the top of the page
 
nuclear_nick
post Mar 15 2019, 07:45 AM
Post#10



Posts: 1,746
Joined: 5-February 06
From: Ohio, USA


I had to deal with it a few years ago, and it was indeed referred to as 'Fixed Width'... if I understand what you're talking about.

Basically it's a CSV without the comma's, so every 'field' is defined by being so many characters wide, and padded by (usually) spaces. So yes, I had to have a table to 'map' out the definitions.

And it was/is a PITA. Especially when they make a change.

--------------------
"Nuclear" Nick
____________
The top three reasons to hide code; 1) It's not your own. 2) It's your own, but it's so crappy you don't want anyone to see it. 3) The comments in your code would get you in a lot of trouble if ever made public.
Go to the top of the page
 
JonSmith
post Mar 15 2019, 10:42 AM
Post#11


UtterAccess VIP
Posts: 4,047
Joined: 19-October 10



Of course they do David, but that calls it by the specific version of the file (to make it complicated here different countries report using different specifications of a PITA file!)
I attached a screenshot, it doesn't call it fixed width or anything.

@Nick,

I think you aren't seeing the full picture.
Its not as simple as you need to map out the fixed widths. You need to map out the fixed widths per LINE!!! As the file contains multiple different mappings.
You have to examine the first x bytes of the file to work out how to parse that line.

In the screenshot I attached you can see the lines starting with H use the 'Header record specs, lines starting with 'D' follow the 'Detail record Specs' etc etc, there were like 12 specs for this one version.
Attached File(s)
Attached File  Capture.PNG ( 45.05K )Number of downloads: 0
 
Go to the top of the page
 
Minty
post Mar 15 2019, 11:27 AM
Post#12



Posts: 309
Joined: 5-July 16
From: UK - Wiltshire


That looks like almost an exact replica of the system I had to work with.
I can't remember precisely but I seem to think it was an AS400 system file spec.

And I had two different ones to deal with. So PITA was pretty accurate.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th June 2019 - 06:09 AM