-1

I have a huge CSS file which should be about 20'000 lines and it was accidentally saved on one line a while ago, making it extremely hard to read and maintain.

I was looking for a tool that would automatically separate lines of CSS files, but I am finding it difficult as I can't find an English definition describing what I'm after. Does anyone know any tool that would do that? I'm sure that such a tool exists somewhere.

It would help me a lot. Thanks.

Florian
  • 5,326
  • 4
  • 26
  • 35
JulioBordeaux
  • 494
  • 1
  • 7
  • 23

3 Answers3

2

Just use stackoverflow's code snippet tool (looks like [<>]) and click tidy...

Eric
  • 95,302
  • 53
  • 242
  • 374
Aaron
  • 10,187
  • 3
  • 23
  • 39
2

As well as using SO's inbuilt feature, you could try looking at CSS Beautifiers.

Such as http://codebeautify.org/

Most of these work with other languages too! Hope this helps

Tommy Jinks
  • 747
  • 6
  • 21
0

Use a splitter, replace system such as

FIND: "; "

REPLACE ";

"

because the ; is the line end for CSS code so this would break all the code-lines into new lines, leaving only the brackets.

So then run the Find/Replace routine again to then add linebreaks outside the } characters.

FIND "}"

REPLACE: "}

";
Martin
  • 22,212
  • 11
  • 70
  • 132