100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Formatted I/O

How Fortran's FORMAT edit descriptors give precise, column-aligned control over how numbers and text are printed and read.

Arrays & NumericsIntermediate10 min readJul 10, 2026
Analogies

Edit Descriptors and the PRINT/WRITE Statement

Fortran's formatted I/O uses edit descriptors packed inside a format string to control exactly how each value is rendered: I5 prints an integer right-justified in a 5-character field, F8.2 prints a real number in fixed-point notation with 8 total characters and 2 decimal places, and A10 prints a character string in a 10-character field. A statement like WRITE(*, '(A, I5, F8.2)') 'Result: ', count, total applies each descriptor to the corresponding output item in order, giving column-aligned output that list-directed WRITE(*,*) cannot guarantee.

🏏

Cricket analogy: A scoreboard that always prints the batsman's score in a fixed 3-digit field so single, double, and triple-digit scores all align in a column mirrors I3 forcing consistent field width regardless of the value's size.

Common Numeric Descriptors

Beyond I and F, Fortran offers E for scientific notation (E12.4 gives something like 0.1234E+05), ES for scientific notation with the mantissa normalized to a single leading nonzero digit, G as a general descriptor that picks a sensible representation automatically, and X for inserting blank spaces between fields, as in WRITE(*, '(I3, 2X, F6.2)'). Repeat counts and grouping are also supported: 3(I4, 1X) repeats that pair of descriptors three times, and the slash / descriptor forces output to continue on a new line within a single WRITE statement.

🏏

Cricket analogy: Printing a bowling figure like 4-32 with two spaces of padding before the economy rate, using I2,2X,F5.2, mirrors the X descriptor inserting deliberate blank space between output fields.

Reading Formatted Input

The same edit descriptors that control output also control input parsing with READ, so READ(unit, '(I4, F6.2)') code, price expects exactly four columns for an integer followed by six columns for a fixed-point real, regardless of embedded spaces. This fixed-column reading is essential for parsing legacy data files where fields are positioned by column rather than delimited by commas or spaces, but it means a single misaligned column in the input file silently reads garbage or triggers a runtime format error rather than gracefully skipping whitespace the way list-directed READ(*,*) would.

🏏

Cricket analogy: Reading a paper scoresheet where the over number always occupies columns 1-3 and the runs always occupy columns 4-6 mirrors fixed-column formatted READ expecting data at exact character positions.

Reusable FORMAT Statements

Instead of inlining a format string in every WRITE, a labeled FORMAT statement can be defined once and referenced by its label: 100 FORMAT(A10, I5, F8.2) followed elsewhere by WRITE(*, 100) name, id, salary. Modern style favors character-parameter format strings instead of numeric labels, such as CHARACTER(LEN=*), PARAMETER :: FMT1 = '(A10, I5, F8.2)' and WRITE(*, FMT1) ..., which avoids scattering unlabeled magic numbers through a program and lets one format definition be reused consistently across many WRITE statements that must line up in the same table.

🏏

Cricket analogy: Defining one reusable scoreboard template used for every innings display, rather than redesigning the layout each time, mirrors a labeled FORMAT statement reused across multiple WRITE statements.

fortran
program formatted_io_demo
  implicit none
  character(len=*), parameter :: hdr_fmt = '(A10, A8, A10)'
  character(len=*), parameter :: row_fmt = '(A10, I8, F10.2)'
  character(len=10) :: name
  integer :: id
  real :: salary

  write(*, hdr_fmt) 'Name', 'ID', 'Salary'

  name = 'Alice'
  id = 1042
  salary = 68500.5
  write(*, row_fmt) name, id, salary

  name = 'Bob'
  id = 1108
  salary = 5321.25
  write(*, row_fmt) name, id, salary

  ! Reading fixed-column data: columns 1-4 integer, 5-10 real
  block
    integer :: code
    real :: price
    character(len=10) :: line = '1042 68.50'
    read(line, '(I4, 1X, F5.2)') code, price
    print *, 'parsed code =', code, ' price =', price
  end block
end program formatted_io_demo

If a numeric value is too large to fit its field width (for example printing 123456 with an I5 descriptor), Fortran does not silently truncate -- it fills the entire field with asterisks (*****) to signal an overflow. Always size numeric fields generously enough for the largest expected value.

  • Edit descriptors (I, F, E, ES, A, X) precisely control field width and representation for each output item.
  • F8.2 means a fixed-point field 8 characters wide with 2 digits after the decimal point.
  • Repeat counts like 3(I4,1X) and the slash (/) descriptor control repetition and line breaks within one WRITE.
  • READ with a format string parses input by fixed column position, unlike flexible list-directed READ(*,*).
  • Reusable FORMAT labels or character-parameter format strings avoid duplicating format definitions.
  • Overflowing a numeric field produces a row of asterisks rather than silent truncation or wraparound.
  • Formatted I/O is essential for producing aligned tables and parsing fixed-width legacy data files.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#FortranStudyNotes#FormattedIO#Formatted#Edit#Descriptors#PRINT#StudyNotes#SkillVeris#ExamPrep

Frequently Asked Questions

21 categories · pick one to explore

Where can I get free study notes for programming and tech subjects?
SkillVeris offers completely free study notes covering programming and tech subjects, with no signup fees or paywalls. The notes are structured by course and topic, written for quick understanding, and enriched with the Learn Through Hobbies analogy method, so you can revise concepts through cricket, music, gaming, cooking and more.
Are SkillVeris study notes good for exam revision?
Yes, the study notes are designed for efficient revision: each topic answers its heading immediately, keeps explanations concise, and links to related glossary terms and cheat sheets. Students preparing for university exams or certification tests use them as quick revision notes because they distil concepts without the padding of full textbooks.
What subjects do the free study notes cover?
The study notes span the platform's main domains, including AI and machine learning, Python and programming, web development, DevOps, cloud, security and databases. Coverage mirrors the 37 live courses, so notes exist for the topics you are actually studying, and new note sets are added as courses launch.
How are SkillVeris study notes different from regular textbooks?
The notes are answer-first, concise and free, whereas textbooks are long and often expensive. Each section explains one concept directly, then reinforces it through selectable hobby analogies like cricket or cooking. Notes also cross-link to the glossary, blog and cheat sheets, letting you jump to related material instantly instead of flipping pages.
Can I use the developer study material without creating an account?
The study notes are free to access, and SkillVeris does not charge anything for its developer study material at any point. Browsing notes is straightforward from the Study Notes section, and if you want progress tracking, certificates and AI Mentor conversations tied to your learning, a free account unlocks those extras.
Do the study notes explain concepts with analogies?
Yes, this is a signature SkillVeris feature. Study notes use the Learn Through Hobbies method, explaining technical concepts through analogies from twelve domains including cricket, music, gaming, photography, travel, movies, fitness, chess, cooking, finance, business and sports. You can switch the analogy domain instantly to whichever hobby makes the concept click.
Are the revision notes suitable for last-minute exam preparation?
Yes, revision notes on SkillVeris work well for last-minute preparation because every section states the answer in its first sentences, so skimming is genuinely effective. Pair them with the relevant cheat sheet for formulas and syntax, and use the glossary for any unfamiliar term you meet while cramming.
Is there free study material for AI and machine learning?
Yes, SkillVeris provides free study notes across its AI and ML catalogue, covering Python for AI, deep learning frameworks like PyTorch and TensorFlow, Hugging Face Transformers, Large Language Models, RAG, AI agents and MLOps. All of it is free, making it a strong resource for Indian students and global learners alike.
Can beginners understand the study notes, or are they for experts?
Beginners can absolutely use them. The notes are written in plain language, define terms as they appear, and lean on hobby analogies to make abstract ideas concrete. Difficulty scales with the underlying course level, so beginner-course notes stay gentle while advanced-course notes go deeper, and the glossary supports you throughout.
How do study notes connect with SkillVeris courses?
Study notes are organised by course and topic, so they map directly to the structured courses and their 24–40-lesson curriculum. Many learners study a lesson first, then use the matching notes for revision before module assessments and the final exam, where 80 percent is required to pass and earn the certificate.
Are there study notes for Python specifically?
Yes, Python is well covered through notes tied to the Python-focused courses, including Python for AI and ML. Topics span fundamentals through applied machine learning usage. You can reinforce the notes with Python practice in Code Lab, which runs code in your browser with no installation required.
Do the study notes include code examples?
Yes, study notes include code examples wherever a concept is best shown in code, alongside explanations, key points and analogies. Reading a snippet in the notes and then reproducing it yourself in Code Lab is an effective loop, since Code Lab lets you run code in the browser across six languages.
How often is new study material added to SkillVeris?
Study material grows alongside the course catalogue. Whenever new courses join the platform's 37 live courses, matching study notes, glossary entries and cheat sheets are added so the resources stay in sync. Existing notes are also refined over time, so it is worth revisiting topics you studied earlier.
Can I use SkillVeris notes to prepare for technical interviews?
Yes, the notes make excellent interview revision because they compress each concept into direct, answer-first explanations, which mirrors how you should answer interview questions. Combine them with the SkillVeris interview questions feature, which includes readiness scoring, to test whether your revision has actually made you interview-ready.
Are the study notes mobile-friendly for studying on the go?
Yes, the study notes are built to load fast and read comfortably on mobile devices, so you can revise during a commute or between classes. Sections are short and answer-first, which suits small screens, and analogy switching works on mobile too, letting you study anywhere without carrying books.
What is the difference between study notes and cheat sheets?
Study notes explain concepts in depth with context, examples and analogies, making them ideal for learning and revision. Cheat sheets are compact quick-reference summaries of syntax, commands and key facts, ideal once you already understand a topic. Most learners study the notes first, then keep the cheat sheet handy while coding.
Do study notes help if I am stuck on a course lesson?
Yes, reading the matching study notes often clarifies a lesson because the same concept is explained from a different angle, frequently with a different analogy. If you are still stuck, ask the AI Mentor, which answers 24/7 at Quick, Detailed or Deep-dive depth until the idea genuinely makes sense.
Is there free study material for DevOps and cloud topics?
Yes, SkillVeris carries free study notes for DevOps and cloud topics as part of its coverage across 37 live courses. The material suits learners following the DevOps Engineer or Cloud Engineer paths, and it links to related glossary terms and cheat sheets so you can revise the whole toolchain in one place.
Can school or college students in India use these notes for projects?
Yes, students across India and worldwide use SkillVeris notes for coursework, projects and exam preparation, and everything is free, which matters for student budgets. The notes explain concepts clearly enough to cite in project reports, and Code Lab lets you prototype the project code directly in your browser.
How should I combine study notes with other SkillVeris resources?
A proven loop: learn from a course lesson, revise with the matching study notes, look up unfamiliar terms in the glossary, keep the cheat sheet open while practising in Code Lab, and quiz yourself with interview questions. The AI Mentor fills any remaining gaps 24/7, at whatever depth you need.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse