-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I wrote a C# program to read an Excel .xls/.xlsx file and output to CSV and Unicode text. I wrote a separate program to remove blank records. This is accomplished by reading each line with StreamReader.ReadLine(), and then going character by character through the string and not writing the line to…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
In Ruby I'm looking to read data until I reach a delimiter or end of file. I found this is possible by redefining $/ or the $INPUT_RECORD_SEPARATOR to my delimiter. However with all the "features" in the Ruby language it seems hokey to change the value of a global to do this. Also, readline used to…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a readline-based application with a prompt, however I'd like it to not show when the input is not interactive.
$ ./readline-app < command-list > result
$ cat result
prompt> Output line 1
prompt> Output line 2
prompt>
$
How can I make the prompt to not print in this case?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am trying to install readline for python 2.7.3 installed via homebrew.
If I type
easy_install readline
I get
Downloading http://pypi.python.org/packages/source/r/readline/readline-6.2.2.tar.gz#md5=ad9d4a5a3af37d31daf36ea917b08c77
Processing readline-6.2.2.tar.gz
Writing /var/folders/44/dhrdb5sx53s243j4w03063vh0000gn/T/easy_install-64FbG8/readline-6…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I create a fifo:
mkfifo tofetch
I run this python code:
fetchlistfile = file("tofetch", "r")
while 1:
nextfetch = fetchlistfile.readline()
print nextfetch
It stalls on readline, as I would hope. I run:
echo "test" > tofetch
And my program doesn't stall anymore. It reads the line…
>>> More