Looking for a Python program that will read a text file with Base n input, and convert it to Hex (and eventually ascii) : I'm very new to Python and I'm looking for help creating a program that will execute the following algorithm.  It's purposely simple, and it should be noted that the data is in a stream, so I can't (or at least, I don't think I can) just open the text file and convert it using a single function.  I'm cranking away at it to learn the language and options, but would like to see how some experts would tackle this problem. Doesn't need to be user friendly and I'd like files output at each step so I can see the output at each step. 

Here's the algorithm I'm recommending:

Open file "base-n.txt"

For each line in file
  Remove carriage returns
  Write line to "Clean File" *#to create a single stream of characters#*

Open file "Clean File"
For each line in file
	Read the first x characters  *#I presume x depends on n in base n#*
	Convert the characters from base n to base 16
	Write the characters to "Output file"

Open file Output File 
For each line in file
	Convert line to ASCII
	Print ASCII line
End

The files are not large... usually just a few hundred lines of base n information.  For example, the below is an example of the base-5 text.

0322040104130344042104140401011204310421011203430342043004010112020301130020
0301042104240401041401120410042204300432041401120400042104130421042401120430
0410043101120342041404010431013401120344042104200430040103440431040104310432
0424011203420400041004220410043003440410042004030112040104130410043101410112
0233043204100430011203440421042004030432040101120413041003430401042404210020
0430040104140134011204200421042001120344042104200433034204130413041004300112
0411043204300431042101120413034203440410042004100342011203420141011203130432
0430042204010420040004100430043004010112042304320410043001120413034203440432
0430011204200421042001120413041004030432041303420112040003420422041003430432
0430002004210424042003420424040101410112031004240421041004200112040003420422

Thanks in advance for the help.  I'm looking forward to getting much better at Python, but have an real need for this algorithm in the short term.

