-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I bash, how do I convert dos/windows newlines to unix? It must be non-interactive, not like starting vi and typing something in, but a command on the command line that can be put in a script file. The dos2unix and unix2dos commands are not available on the system.
How do I do this with commands like…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a text file ("INPUT.txt") of the format:
A<LF>
B<LF>
C<LF>
D<LF>
X<LF>
Y<LF>
Z<LF>
<EOF>
which I need to reformat to:
A:B:C:D:X:Y:Z<LF>
<EOF>
I know you can do this with 'sed'. There's a billion google hits for doing this with…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am trying to write a ruby string to a file in such a way that any newline characters embedded in the string remain embedded. This is being written out to a file which will then be processed by another tool.
An example is below.
I want this: 1 [label="this is a\ntest"] \n (second \n is a true newline)
I…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
How can I test if the string is empty in Python?
For example,
"<space><space><space>" is empty, so is
"<space><tab><space><newline><space>", so is
"<newline><newline><newline><tab><newline>", etc.
>>> More
-
as seen on Programmers
- Search for 'Programmers'
Right now this is just a crazy idea that I had, but I was able to implement the code and get it working properly. I am not entirely sure of what the use cases would be just yet.
What this code does is create a new Lua script file in the project directory. The ScriptWriter takes as arguments the…
>>> More