<div>Hi, ALL,</div>
<div>I have a csv file which depending on how it was produced gives 2 different strings as shown in the example below (test1 and test2).</div>
<div>I am only interested in the first field in test1 and obviously in the whole string of test2.</div>
<div> </div>
<div>So, I tried to see if I can get what I want in one simple way, but failed.</div>
<div>Is it possible to process the file independently?</div>
<div> </div>
<div>Thank you.</div>
<div> </div>
<div>python<br>Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> test1 = "a,,,,"<br>
>>> test2 = "a"<br>>>> (t1,_) = test1.split(',')<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>ValueError: too many values to unpack<br>
>>> (t2,_) = test2.split(',')<br>Traceback (most recent call last):<br>  File "<stdin>", line 1, in <module><br>ValueError: need more than 1 value to unpack<br>>>></div>