Mailinglist Archive: opensuse (818 mails)

< Previous Next >
Re: [opensuse] Java script assistance (slightly OT)
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Mon, 19 Sep 2011 16:01:56 +0200
  • Message-id: <j57i0j$qqp$>
Peter Nikolic wrote:

On Monday 19 September 2011 09:17:02 Per Jessen wrote:
Peter Nikolic wrote:
Hi .

This is slightly OT but not too bad i hope .

I have a numbver of .js files that are strung out in one huge line
text they are a real pain to do anything with and take an age to
load and edit

Is there a way other than sitting ther and manually sorting the of
doing it automatically ..

You could try something like this:

sed -e 's/{/\n{/' -e s'/}/}\n/' <filename

(not sure if you need to escape the curly brackets).

Hi Per

Thanks i will give it a whirl later see what happens on a copy of the
file i have seen the online systems but the darn file takes so long to
load into an editor or just do a less on that i cant C&P it across
real pain .

Hi Peter

this is better:

sed -e 's/{/\n{/g' -e s'/}/}\n/g' -e s'/;/;\n/g' <filename

(still not sure if you need to escape the curly brackets).

Per Jessen, Zürich (11.6°C)

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups