41

Is there a way in Notepad++ to convert a comma-separated file to fixed width columns?

This feature exists in UltraEdit and explained in Working with CSV files, but I am happy with my Notepad++, and I don't want to pay for a copy of UltraEdit.

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
ercan
  • 833
  • 2
  • 8
  • 16

4 Answers4

49

Use the built in TextFX menu.

TextFX -> TextFX Edit -> Line up multiple lines by (,)

I didn't discover this on my own, I found it on sourceforge while trying to figure out this exact question!

Chance
  • 616
  • 6
  • 4
10

In the meantime I have just found a very nice tool for that. It's called CSVed and available here, with many many nice features. If you hate Excel when viewing CSV files like I do, you should give it a try.

ercan
  • 833
  • 2
  • 8
  • 16
1

For TSV files (tab separated) and newer Notepad++ release (either x86 or x64) the plugin Elastic Tabs is very helpful for this. I have it configured for .tsv files and it works like a charm.

Another plugin that maybe helpful in conjunction is CSV Lint, but didn't had the need for it yet. It features conversion between CSV comma, CSV semicolon and TSV formats.

Maddes
  • 131
  • 4
0

Yes, it's possible in Notepad: menu Edit -> Replace... -> ReplaceAll ',' by '\t'.

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
albs
  • 25
  • 1
  • 6
    -1. Converting it into a TAB separated format does not make it a fixed width column format. – Peter Mortensen Feb 15 '14 at 18:50
  • 3
    Literally using "\t" does not work, neither in Notepad or Notepad++. It is always a challenge to use a TAB character in a dialog. A common work-around is to enter a TAB character in a document, put it into the clipboard by a cut (Ctrl + X) and pasting it into the field in the replace dialog. – Peter Mortensen Feb 15 '14 at 18:55
  • 2
    OK, in Notepad++, selecting the option "Extended (\n, \r, \t, \0, \x)" makes it work. – Peter Mortensen Feb 15 '14 at 19:09
  • TextFX -> TextFX Edit -> "split lines at..." – JinSnow Aug 10 '15 at 19:15
  • 1
    @PeterMortensen It doesn't work unless your tab size is longer than (length of longest entry in column) - (length of shortest in column). E.g., if your tab size is 4, your longest line is 20, and your shortest line is 5. That, a very common use case, will still result in an uneven file. – jpmc26 Aug 10 '16 at 00:17
  • @PeterMortensen But not in Notepad, as the user albs says. – Alex Jan 19 '18 at 20:26