I have done this operation millions of times, just using the +
operator! I have no idea why it is not working this time, it is overwriting the first part of the string with the new one! I have a list of strings and just want to concatenate them in one single string! If I run the program from Eclipse it works, from the command-line it doesn't!
The list is:
["UNH+1+TCCARQ:08:2:1A+%CONVID%'&\r", "ORG+1A+77499505:PARAF0103+++A+FR:EUR++11730788+1A'&\r", "DUM'&\r", "FPT+CC::::::::N'&\r", "CCD+CA:5132839000000027:0450'&\r", "CPY+++AF'&\r", "MON+712:1.00:EUR'&\r", "UNT+8+1'\r"]
I want to discard the first and the last elements, the code is:
ediMsg = ""
count = 1
print "extract_the_info, lineList ",lineList
print "extract_the_info, len(lineList) ",len(lineList)
while (count < (len(lineList)-1)):
temp = ""
# ediMsg = ediMsg+str(lineList[count])
# print "Count "+str(count)+" ediMsg ",ediMsg
print "line value : ",lineList[count]
temp = lineList[count]
ediMsg += " "+temp
print "ediMsg : ",ediMsg
count += 1
print "count ",count
Look at the output:
extract_the_info, lineList ["UNH+1+TCCARQ:08:2:1A+%CONVID%'&\r", "ORG+1A+77499505:PARAF0103+++A+FR:EUR++11730788+1A'&\r", "DUM'&\r", "FPT+CC::::::::N'&\r", "CCD+CA:5132839000000027:0450'&\r", "CPY+++AF'&\r", "MON+712:1.00:EUR'&\r", "UNT+8+1'\r"]
extract_the_info, len(lineList) 8
line value : ORG+1A+77499505:PARAF0103+++A+FR:EUR++11730788+1A'&
ediMsg : ORG+1A+77499505:PARAF0103+++A+FR:EUR++11730788+1A'&
count 2
line value : DUM'&
DUM'& : ORG+1A+77499505:PARAF0103+++A+FR:EUR++11730788+1A'&
count 3
line value : FPT+CC::::::::N'&
FPT+CC::::::::N'&+1A+77499505:PARAF0103+++A+FR:EUR++11730788+1A'&
count 4
line value : CCD+CA:5132839000000027:0450'&
CCD+CA:5132839000000027:0450'&PARAF0103+++A+FR:EUR++11730788+1A'&
count 5
line value : CPY+++AF'&
CPY+++AF'&2839000000027:0450'&PARAF0103+++A+FR:EUR++11730788+1A'&
count 6
line value : MON+712:1.00:EUR'&
MON+712:1.00:EUR'&00027:0450'&PARAF0103+++A+FR:EUR++11730788+1A'&
count 7
MON+712:1.00:EUR'&00027:0450'&FR:EUR++11730788+1A'&
Why is it doing so!?