hi everybody,<br> I have a file separated by hash:<br>as shown below,<br>file:<br>A#1<br>B#2<br>A#2<br>A#3<br>B#3<br><br>I need the result like this:<br>A 1#2#3<br>B 2#3<br><br>how will generate the result like this from the above file
<br>can somebody tell me what i have to do......<br>My code:<br> fh =open('abc_file','r')<br> for line in fh.readlines():<br> data = line.strip().split('#')<br> for data[0] in line
<br> print line<br><br>I tried but i donot know how to create 1#2#3 in a single line<br>regards<br>shafreen<br>