View Single Post
Old 2014-10-31, 14:00   #2
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

10000101010112 Posts
Default

If doing a little bit of manual work, you can use a text editor: In any decent text editor (e.g. Notepad++), use regex to find/replace, e.g.
Code:
^(\d+) (\d+)$
replace with
Code:
PRP=\1,2,\2,-1
will transform

Code:
some header line
456 789456
789 456987
to

Code:
some header line
PRP=456,2,789456,-1
PRP=789,2,456987,-1
If you need it to be an automated script, you might do something like this pseudo-Python:
Code:
for line in read(input_file):
    # if it's an actual line and not a header
    k, n = split(line)
    print('PRP={},2,{},-1', k, n)
Mini-Geek is offline   Reply With Quote