hi: I have a very large file 15Gb. Starting from 15th line this file shows the following lines:
HWUSI-EAS1211_0001:1:1:977:20764#0 HWUSI-EAS1211_0001:1:1:977:20764#0 HWUSI-EAS1521_0001:1:1:978:13435#0 HWUSI-EAS1521_0001:1:1:978:13435#0 Every two lines are part of one readgroup. I want to add two variables to every line. First variable goes to all lines with odd numbers. Second variable should be appended to all even number lines. like the following: HWUSI-EAS1211_0001:1:1:977:20764#0 RG:Z:2301 HWUSI-EAS1211_0001:1:1:977:20764#0 RG:Z:2302 HWUSI-EAS1521_0001:1:1:978:13435#0 RG:Z:2301 HWUSI-EAS1521_0001:1:1:978:13435#0 RG:Z:2302 Since I cannot read the entire file, I wanted to cat the file something like this: cat myfile | python myscript.py > myfile.sam I do not know how to execute my logic after I read the line, althought I tried: myscript.py: while True: second = raw_input() x = second.split('\t') Could someone help me here either what I want to do. Or suggesting a different method. thanks
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor