G
Greg Lindstrom
Hello-
I have a file generated by an HP-9000 running Unix containing form feeds
signified by ^M^L. I am trying to scan for the linefeed to signal
certain processing to be performed but can not get the regex to "see"
it. Suppose I read my input line into a variable named "input"
The following does not seem to work...
input = input_file.readline()
if re.match('\f', input): print 'Found a formfeed!'
else: print 'No linefeed!'
I also tried to create a ^M^L (typed in as <ctrl>Q M <ctrlQ> L) but that
gives me a syntax error when I try to run the program (re does not like
the control characters, I guess). Is it possible for me to pull out the
formfeeds in a straightforward manner?
Thanks!
--greg
--
Greg Lindstrom 501 975.4859
Computer Programmer (e-mail address removed)
NovaSys Health
Little Rock, Arkansas
"We are the music makers, and we are the dreamers of dreams." W.W.
Confidentiality Notice
I have a file generated by an HP-9000 running Unix containing form feeds
signified by ^M^L. I am trying to scan for the linefeed to signal
certain processing to be performed but can not get the regex to "see"
it. Suppose I read my input line into a variable named "input"
The following does not seem to work...
input = input_file.readline()
if re.match('\f', input): print 'Found a formfeed!'
else: print 'No linefeed!'
I also tried to create a ^M^L (typed in as <ctrl>Q M <ctrlQ> L) but that
gives me a syntax error when I try to run the program (re does not like
the control characters, I guess). Is it possible for me to pull out the
formfeeds in a straightforward manner?
Thanks!
--greg
--
Greg Lindstrom 501 975.4859
Computer Programmer (e-mail address removed)
NovaSys Health
Little Rock, Arkansas
"We are the music makers, and we are the dreamers of dreams." W.W.
Confidentiality Notice