News for hackers. Stuff that matters.
Re:Do you have a problem? Write a compiler by ahmedalsudani on Thursday October 03, 2019 @01:31AM (#21144016)
Macros, regex, awk are the tools to quickly automate text processing. It literally takes less than two minutes in most cases once you’re proficient.
Re:Do you have a problem? Write a compiler by fastball on Thursday October 03, 2019 @02:03AM (#21144167)
Honestly the amount of time I've saved just by throwing stuff into a text editor with multi-cursor support is kinda unbelievable.
Re:Do you have a problem? Write a compiler by rmetzler on Thursday October 03, 2019 @06:41AM (#21145496)
Yes, this is the right thing to do very often, especially for one time tasks.

It’s not the thing you should do if you need to do it repeatedly, like once a day or even once a month.

This all depends on a lot of circumstances, and its hard to calculate time for implementing a script vs doing it by hand for a future you don’t know yet.

Re:Do you have a problem? Write a compiler by rdc12 on Thursday October 03, 2019 @07:09AM (#21145659)
I often do a similar thing using emacs macros (I assume most good editors have a similar feature)
Re:Do you have a problem? Write a compiler by sinstein on Thursday October 03, 2019 @02:54AM (#21144405)
Step 1 - Let me try using command line magic to transform this data Step 2 - ?? Step 3 - Create a scratch file in IDEA and some cursor + regex magic and I am done!
Re:Do you have a problem? Write a compiler by rmetzler on Thursday October 03, 2019 @06:49AM (#21145545)
And those regexes are the first part of an awk script or something similar which will save time when you want to do this repeatedly.

And when your awk script grows into something that doesn’t produce the final output, but has to be run in another interpreter first in order to produce the final result, then you created your custom language.

Re:Do you have a problem? Write a compiler by taneq on Thursday October 03, 2019 @01:42AM (#21144066)
Oh sure, if it's absolutely trivial then bash it (hah) through some shell scripts or even just do it on the command line. I'm talking more about things that are slightly more complicated and will need a bit more effort than find & replace.