>> Maybe you could break that up a bit? This is the tutor list, not a
>> one-liner competition!
>
> rather than one-liners, we can try to create the most "Pythonic" solution.
> below's my entry. :-)
>
> myMac$ cat parafiles.py
> #!/usr/bin/env python
>
> from itertools import izip
> from os.path i
on a related note, there is a module called fileinput that doesn't do
what you (the OP) need for this particular problem, but it is one to
keep in mind for the future as there may be a situation for which it
is the right tool. it doesn't get a lot of buzz but can come in handy
-- for me, it was in
>> Thankyou sir it is working.but one more thing i want to ask that if my
>> file will have entries like:---
>>
>> fileA and fileB
>> 12 10
>> 13 12
>> 14
>> 15
>>
>> means if their no. of entries will not match then how to combine them(both
>> input files have more than one col
2009/7/18 :
> Thankyou sir it is working.but one more thing i want to ask that if my
> file will have entries like:---
>
> fileA and fileB
> 12 10
> 13 12
> 14
> 15
>
> means if their no. of entries will not match then how to combine them(both
> input files have more than one c
Thankyou sir it is working.but one more thing i want to ask that if my
file will have entries like:---
fileA and fileB
12 10
13 12
14
15
means if their no. of entries will not match then how to combine them(both
input files have more than one column).
Thanks,
Amrita
>> Maybe
> Maybe you could break that up a bit? This is the tutor list, not a
> one-liner competition!
rather than one-liners, we can try to create the most "Pythonic"
solution. below's my entry. :-)
cheers,
-wesley
myMac$ cat parafiles.py
#!/usr/bin/env python
from itertools import izip
from os.path im
On 7/17/2009 1:27 PM Kent Johnson said...
On Fri, Jul 17, 2009 at 3:14 PM, Emile van Sebille wrote:
delim= '\t'
file('ala', 'w').writelines(
[ delim.join([ii,jj] for ii,jj in
zip(
[xx.strip() for xx in
file('/home/amrita/alachems/chem2.txt','r').readlines()
],
file(
On Fri, Jul 17, 2009 at 3:14 PM, Emile van Sebille wrote:
> delim= '\t'
>
> file('ala', 'w').writelines(
> [ delim.join([ii,jj] for ii,jj in
> zip(
> [xx.strip() for xx in
> file('/home/amrita/alachems/chem2.txt','r').readlines()
> ],
> file('/home/amrita/pdbfile/pdb2.t
On 7/17/2009 11:37 AM amr...@iisermohali.ac.in said...
Hi,
I have two large different column datafiles now i want to join them as
single multi-column datafile:--
I tried the command:--
file('ala', 'w').write(file('/home/amrita/alachems/chem2.txt',
'r').read()+file('/home/amrita/pdbfile/p
wrote
but it is priniting second file after first, whereas i want to join them
columwise like:---
FileA FileB FileC
12 14 12 14
15 + 16 = 15 16
18 17 18 17
20 19 20 19
I'm not sure what the plus sign in the second line signifies
but otherwise it look
Hi,
I have two large different column datafiles now i want to join them as
single multi-column datafile:--
I tried the command:--
>>> file('ala', 'w').write(file('/home/amrita/alachems/chem2.txt',
'r').read()+file('/home/amrita/pdbfile/pdb2.txt', 'r').read())
but it is priniting second file
11 matches
Mail list logo