Thread: Learning Python interpret text file, manipulate output text
hi -
i'm learning python specific purpose; create bandaid solution problem i'm encountering.
i'm looking out of post confirmation approaching problem in correct way, , guidance towards end.
the problem
application use exports text file a series of data interpreted application. text export first application has changed , no longer compatible second application. i'm trying write program open text file export, dissect it, , create new text file in correct format.
input file characteristics
text file has number of key things note:
* contains header line.
* contains ~12 variables line (some numbers, text, dollars).
* of these variables begin , end @ specific line positions. others either start or end @ specific position. variables may not present given line.
* number of lines need interpreted unknown, , should variable.
application requirements
* needs interpret origin text file, , decipher variables on each line.
* output variables, line line, in specific character positions
* output text file
my approach / questions
* use python 3.2 handle this. it's language have been meaning learn. don't mind using else though if makes more sense.
* when used program in c++, have searched out via if statements , position position in array. way handle in python? regular expression better way handle it?
* big picture, writing application suitable method solve problem?
* can provide few sample lines origin text file if helps understand problem better.
taking time read, , insight point me in right direction.
it nice see example input , output file. python fine script has string manipulation methods. common problem, i'm sure lots of people out.
description, each line contains multiple variables. depending on variable, have specified length? there delimiters between variables?
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Learning Python interpret text file, manipulate output text
Ubuntu
Comments
Post a Comment