Program to view and edit fixed width text files?

15,450

Solution 1

The key point everyone is overlooking is the files contain no carriage returns. That is, it sounds like the text files are just one long line that cycles through three fields of length 15, 12, and 30.

You can probably use any text editor with a fixed width font, if you turn on word wrap and resize the window to be exactly 57 characters wide. You probably also want a text editor with overtype mode, so the fields will stay lined up as you edit.

(Edit: As I commented on Mush's answer, WordPad might work with the following setup. Go to View, Options, Text. Select "Wrap to ruler" and check Ruler so the ruler is visible. Then drag the right margin triangle in the ruler until you get the text to wrap at exactly the 57 characters you need. Also, press the Insert key on the keyboard to turn on overtype mode.)

A hex editor might work, if you can set it to exactly 57 characters per line. I have XVI32 on my computer, but even at the smallest font size and with the address column turned off, I could only fit about 45 characters per line on my 1024 × 768 screen. If your screen resolution is larger you may be able to squeeze in the 57 characters you need. The problem is XVI32 always shows both the hex data and text data, but it sounds like you're looking for a similar editor, but just need the text view.

Solution 2

You could look at:

The RecordEditor will display the file in Table format:

enter image description here

But you can change to a Text-Edit view (View >>> Text View (Highlighted fields):

enter image description here

It is probably best to not make changes in text view though

Solution 3

If it is a fixed width, notepad should be able to do it fine and I use it for something similar - I am unsure why you are having these problems but I can take a guess.

You are probably using a fancy font of some sort. Go in to Format > Font and choose Lucida Console as the font, or System\any other fixed width font and you should not have any problems.

You may also want to look at other tools such as Notepad++ (available on Ninite for easy installation) or Notepad2

Solution 4

Hopefully this isn't a stupid question, but did you try Wordpad?

Share:
15,450

Related videos on Youtube

autonomy
Author by

autonomy

Been in IT work since 1985

Updated on September 17, 2022

Comments

  • autonomy
    autonomy almost 2 years

    I'm looking for a program that can view and edit text files that contain data in a fixed width format.

    The files contain no carriage returns.

    I've tried viewing them in excel but the import process makes me insert a break line at every column. The text has 3 columns total, with 15, 12, and then 30 characters in each.

    Does anyone know how I can view these files without opening them in notepad where they look like just a jumble of text?

    Thanks

    • Kez
      Kez over 14 years
      What exactly did you use to create the file to begin with?
    • MarioDS
      MarioDS over 7 years
      In case anyone ever facing a similar problem finds this: the best approach would be to "fix" the file first by inserting carriage returns, using an editor that supports regex (I use Notepad++). Replace (.+){57} with \1\r\n to insert the line breaks where they are required. (explanation: replace every sequence of exactly 57 characters, with that sequence followed by a carriage return and a line break)
  • mindless.panda
    mindless.panda over 14 years
    I would second the Notepad++ recommendation.
  • Ye Lin Aung
    Ye Lin Aung over 14 years
    of course, +1 for Notepad++ too :)
  • akira
    akira over 14 years
    real man use vim :)
  • William Hilsum
    William Hilsum over 14 years
    @Akira :P .... real men just use a magnetised pin and manually change bits on a hard drive!.... Seriously, I don't mind VIM, but I say, if there is a tool that lets you do something easier and quicker - use it!
  • akira
    akira over 14 years
    hehe, i was just ... tickling the notepad*-fanboys, i actually do not really care about what others use to get their stuff done.
  • Bavi_H
    Bavi_H over 14 years
    WordPad might work with the following setup. Go to View, Options, Text. Select "Wrap to ruler" and check Ruler so the ruler is visible. Then drag the right margin triangle in the ruler until you get the text to wrap at exactly the 57 characters you need. Also, press the Insert key on the keyboard to turn on overtype mode.
  • autonomy
    autonomy over 14 years
    Your right Bavi_H. It's just one long string. That XVI32 is the closest thing I've found to what I'm looking for. But like yours, my screen isn't wide enough.
  • Matthew
    Matthew almost 5 years
    Record Editor is quirky and a little buggy but very handy