Fixed length data file with multiple records per line

Data files transferred to PC's from Mainframe computers are frequently in a fixed-length format with no "Carriage Return - Line Feed" indicators at the end of the records. For these files, each record contains a fixed number of characters, its "record length".

 

Here is such a file. I have broken it into lines of twice the "record length" for the sake of convenient display, but the file itself is just one long string of numbers.

 

This is data file, TAPEDAT.txt:

 

Fred    2625232032131000110110George  2925202423320100110111

Mabel   2622212643411001000003Alice   2923212421321010010011

Grace   2723262424311111011012Arthur  2523222222140001010111

Mary    2825212412431100000003Belinda 2627222431320111011111

 

The test is of 10 items, divided into 4 groups. Group 1 is items 1,2,3. Group 2 is items 4,5,6. Group 3 is items 7,8,9. Group 4 is just item 10. The judging plan rotates the judges across subjects, item groups and sessions in a random manner, but without duplication of rating. Thus the items in group one for subject Fred were rated by judge 26 in session 3. Item 1 was rated 1, Items 2 and 3 were rated 0. The first 9 items are dichotomies (0=failed, 1= passed). Item 10 is on a four-point Likert scale scored 0, 1, 2 ,3. Schematically the data record is:

 

This is entered in each 30 character record as follows:

 

Columns

 1-8 Subject

9-10 Judge for item group 1

11-12 Judge for item group 2

13-14 Judge for item group 3

15-16 Judge for item group 4

  17 Session number for item group 1

  18 Session number for item group 2

  19 Session number for item group 3

  20 Session number for item group 4

21-30 Ratings for Items 1-10

 

The Facform keyword file, TAPEkey.txt, to reformat this fixed length file is:

 

; File: TAPEkey.txt

; This converts a file with multiple records per data line

$Input = tapeDAT.txt

$Length = 30         ; the fixed length record length

$Output = tapeFAC.txt

 

$Facets = 5 ;Subject, Item group, Judge, Session, Item

$Flabel = 1, Subject

$Flabel = 2, "Item Group"  ; This facet is included "just in case"

$Flabel = 3, Judge

$Flabel = 4, Session

$Flabel = 5, Item

 

$Spec = "Title = Demonstration of Fixed Length data file"

$Spec = "Output = tapeOUT.txt ; the output of the FACETS analysis"

$Spec = "Models =       ; we model only subject-judge-item here"

$Spec = "?,,?,,10,R     ;Item 10 has a rating (or partial credit) scale"

$Spec = "?,,?,,?,D      ;Items 1-9 dichotomies"

$Spec = "*"

 

$Label = 1,,$S1W8        ;Subject name

Ig = 0  ;used to keep track of item group

Item = 0 ; reset item number

$Do = 4

Ig = Ig +1

$Label = 2,Ig        ;Item group

$Label = 3,$S(IG*2+7)W2 ;Judge

$Label = 4,$S(IG+16)W1  ;Session

$Do = 3 ;Items in groups of 3

Item = Item +1

$If = (Item=<10)     ;No item greater than 10

$Label = 5,Item,Item   ;Item

$Rating = $S(Item+20)W1 ;Rating

 $Endif

$Again

$Again

 

The resulting Facets file is TAPEFAC.txt:

 

; FACFORM Version No. 1.20,  May 4, 1992

; Run on 05-04-1992 12:44:12

; from Keyword file: TAPEkey.txt

Facets = 5

Title = Demonstration of Fixed Length data file

Output = tapeOUT.txt ; the output of the FACETS analysis

Models =       ; we model only subject-judge-item here

?,,?,,10,R     ;Item 10 has a rating (or partial credit) scale

?,,?,,?,D      ;Items 1-9 dichotomies

*

Labels =

1,Subject

1=Alice

2=Arthur

|

7=Mabel

8=Mary

*

2,Item Group

1=

2=

3=

4=

*

3,Judge

20=

21=

 

|

28=

29=

*

4,Session

1=

2=

3=

4=

*

5,Item

1=

2=

|

9=

10=

*

Data =

4,1,26,3,1-3,1,0,0

4,2,25,2,4-6,0,1,1

4,3,23,3,7-9,0,1,1

4,4,20,3,10,0

5,1,29,2,1-3,0,1,0

|

8,4,24,3,10,3

3,1,26,3,1-3,0,1,1

3,2,27,1,4-6,1,0,1

3,3,22,3,7-9,1,1,1

3,4,24,2,10,1


Help for Facform Rasch Measurement Software: www.winsteps.com. Author: John Michael Linacre

For more information, contact info@winsteps.com or use the Contact Form
 

Facets Rasch measurement software. Buy for $149. & site licenses. Freeware student/evaluation download
Winsteps Rasch measurement software. Buy for $149. & site licenses. Freeware student/evaluation download

State-of-the-art : single-user and site licenses : free student/evaluation versions : download immediately : instructional PDFs : user forum : assistance by email : bugs fixed fast : free update eligibility : backwards compatible : money back if not satisfied
 
Rasch, Winsteps, Facets online Tutorials

 

Forum Rasch Measurement Forum to discuss any Rasch-related topic

Click here to add your email address to the Winsteps and Facets email list for notifications.

Click here to ask a question or make a suggestion about Winsteps and Facets software.

Rasch Publications
Rasch Measurement Transactions (free, online) Rasch Measurement research papers (free, online) Probabilistic Models for Some Intelligence and Attainment Tests, Georg Rasch Applying the Rasch Model 3rd. Ed., Bond & Fox Best Test Design, Wright & Stone
Rating Scale Analysis, Wright & Masters Introduction to Rasch Measurement, E. Smith & R. Smith Introduction to Many-Facet Rasch Measurement, Thomas Eckes Invariant Measurement with Raters and Rating Scales: Rasch Models for Rater-Mediated Assessments, George Engelhard, Jr. & Stefanie Wind Statistical Analyses for Language Testers, Rita Green
Rasch Models: Foundations, Recent Developments, and Applications, Fischer & Molenaar Journal of Applied Measurement Rasch models for measurement, David Andrich Constructing Measures, Mark Wilson Rasch Analysis in the Human Sciences, Boone, Stave, Yale
in Spanish: Análisis de Rasch para todos, Agustín Tristán Mediciones, Posicionamientos y Diagnósticos Competitivos, Juan Ramón Oreja Rodríguez
Winsteps Tutorials Facets Tutorials Rasch Discussion Groups

 

Coming Rasch-related Events
Jan. 5 - Feb. 2, 2018, Fri.-Fri. On-line workshop: Practical Rasch Measurement - Core Topics (E. Smith, Winsteps), www.statistics.com
Jan. 10-16, 2018, Wed.-Tues. In-person workshop: Advanced Course in Rasch Measurement Theory and the application of RUMM2030, Perth, Australia (D. Andrich), Announcement
Jan. 17-19, 2018, Wed.-Fri. Rasch Conference: Seventh International Conference on Probabilistic Models for Measurement, Matilda Bay Club, Perth, Australia, Website
Jan. 22-24, 2018, Mon-Wed. In-person workshop: Rasch Measurement for Everybody en español (A. Tristan, Winsteps), San Luis Potosi, Mexico. www.ieia.com.mx
April 10-12, 2018, Tues.-Thurs. Rasch Conference: IOMW, New York, NY, www.iomw.org
April 13-17, 2018, Fri.-Tues. AERA, New York, NY, www.aera.net
May 22 - 24, 2018, Tues.-Thur. EALTA 2018 pre-conference workshop (Introduction to Rasch measurement using WINSTEPS and FACETS, Thomas Eckes & Frank Weiss-Motz), https://ealta2018.testdaf.de
May 25 - June 22, 2018, Fri.-Fri. On-line workshop: Practical Rasch Measurement - Core Topics (E. Smith, Winsteps), www.statistics.com
June 27 - 29, 2018, Wed.-Fri. Measurement at the Crossroads: History, philosophy and sociology of measurement, Paris, France., https://measurement2018.sciencesconf.org
June 29 - July 27, 2018, Fri.-Fri. On-line workshop: Practical Rasch Measurement - Further Topics (E. Smith, Winsteps), www.statistics.com
July 25 - July 27, 2018, Wed.-Fri. Pacific-Rim Objective Measurement Symposium (PROMS), (Preconference workshops July 23-24, 2018) Fudan University, Shanghai, China "Applying Rasch Measurement in Language Assessment and across the Human Sciences" www.promsociety.org
Aug. 10 - Sept. 7, 2018, Fri.-Fri. On-line workshop: Many-Facet Rasch Measurement (E. Smith, Facets), www.statistics.com
Sept. 3 - 6, 2018, Mon.-Thurs. IMEKO World Congress, Belfast, Northern Ireland www.imeko2018.org
Oct. 12 - Nov. 9, 2018, Fri.-Fri. On-line workshop: Practical Rasch Measurement - Core Topics (E. Smith, Winsteps), www.statistics.com

 
Concerned about aches, pains, youthfulness? Mike and Jenny suggest Liquid Biocell