PDA

View Full Version : Text editing challenge



Fbot1
October 13th, 2007, 09:46 PM
I'm curious how people would simplify the structure of the attached text file with their favorite text editor and customization. Here's a very simple example with a very simple text editor (each line is a press):

Microsoft Notepad:


Ctrl H
(
(
)
)
Tab
(
)
Tab
Tab
Tab
Tab
Hold Enter till it stops

Fbot1
October 13th, 2007, 10:45 PM
Wow, I guess no one really does use text editors any more. :?

p_quarles
October 13th, 2007, 10:46 PM
I use text editors (Vim, Kate and SciTE) all the time. I just don't really understand your question.

Fbot1
October 13th, 2007, 10:54 PM
I use text editors (Vim, Kate and SciTE) all the time. I just don't really understand your question.

How would you use your editor's features to simplify the text.

red_Marvin
October 13th, 2007, 11:16 PM
Do you mean "How would you do to produce the file in the attachment?"?

Fbot1
October 13th, 2007, 11:19 PM
Do you mean "How would you do to produce the file in the attachment?"?

No, how do you remove the redundancies.

red_Marvin
October 13th, 2007, 11:25 PM
Well that depends on what is wiewed as redundant of course...

Lux Perpetua
October 13th, 2007, 11:39 PM
In Emacs:

C-SPC
ESC
C-e
C-w
C-x
C-s

Fbot1
October 13th, 2007, 11:45 PM
In Emacs:

C-SPC
ESC
C-e
C-w
C-x
C-s

](*,)

No!

Fbot1
October 13th, 2007, 11:48 PM
Well that depends on what is wiewed as redundant of course...

Okay, like in the example (()) = ().

n3tfury
October 13th, 2007, 11:48 PM
damn bots.

Fbot1
October 13th, 2007, 11:55 PM
damn bots.

:(

red_Marvin
October 13th, 2007, 11:58 PM
gedit (from memory)
ctrl+h
(())
tab
tab
()
alt+a
repeat

EDIT:
Hmmm, it seems to take an awful lot of time to complete this, either that or it has frozen...
If I'd knew this beforehand I'd probably write a script in python or something.
EDIT2:
Looking at the data amount now -of course I'd write a script!

Fbot1
October 14th, 2007, 12:06 AM
gedit (from memory)
ctrl+h
(())
tab
tab
()
alt+a

You wouldn't go any farther?

n3tfury
October 14th, 2007, 12:11 AM
:(

lol, was a joke. no harm, no foul.

thisllub
October 14th, 2007, 12:14 AM
Vim
v$x
or dd

red_Marvin
October 14th, 2007, 12:19 AM
You wouldn't go any farther?
I didn't see that it was nested at first, since it is, it would have to be repeated, but that kind of replacement is a task for an editor with more advanced search&replace functions, or as In my case, a python script.