daveconor 1 Posted August 22, 2013 Report Share Posted August 22, 2013 Any idea why I get an extra empty line whenever I add a list to list from file The CSV file has 10 rows but it adds 11 items Row one at position 0 and row 10 at position 9 which is fine, but then there's position 10 (11th item) Cant figure out why, thanks in advance. add list to list(%test, $list from file("C:\\...\Test.csv"), "Delete", "Global") Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 22, 2013 Report Share Posted August 22, 2013 Try using the trim function. Quote Link to post Share on other sites
daveconor 1 Posted August 22, 2013 Author Report Share Posted August 22, 2013 thanks helloinsomnia but I really want to know why its doing it, Ive got a fix, it just bugs me. Quote Link to post Share on other sites
UBotDev 276 Posted August 22, 2013 Report Share Posted August 22, 2013 I think you have a blank line at the end of the file (I guess you don't see it with your text editor...hope you are not using Windows Notepad), which adds one extra/empty line to the end of your list. HelloInsomnia suggested you use trim function to remove that extra/empty line from text, and then create a list from it. Quote Link to post Share on other sites
daveconor 1 Posted August 23, 2013 Author Report Share Posted August 23, 2013 (edited) I created a new CSV file and still got the extra line, used notepad++ and it was fine. I just don't get why it does that. Update: used notepad++ to open the CSV file and yea theres the empty line, excel... Edited August 23, 2013 by daveconor Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 23, 2013 Report Share Posted August 23, 2013 I created a new CSV file and still got the extra line, used notepad++ and it was fine. I just don't get why it does that. You used normal notepad? if so then just set notepad++ to default as it's way better anyways If you used excel then try something like Libre Office (it's open source) Quote Link to post Share on other sites
UBotDev 276 Posted August 23, 2013 Report Share Posted August 23, 2013 I created a new CSV file and still got the extra line, used notepad++ and it was fine. I just don't get why it does that. Update: used notepad++ to open the CSV file and yea theres the empty line, excel...I think that CSV standad says that you can have an empty line at the end of the file, that's why some software append empty line, and others don't (if I remember correctly also UBot v3 was appending blank line). So if you want the bot to be compatible with CSV standard, you should remove that blank row before processing the table data. You used normal notepad? if so then just set notepad++ to default as it's way better anyways If you used excel then try something like Libre Office (it's open source) That's exactly what I wanted to say...get Notepad++ or anything else, just don't use Windows Notepad. Quote Link to post Share on other sites
seoeymard 2 Posted August 26, 2013 Report Share Posted August 26, 2013 I am having the same problem with the notepad thing when importing it to the list to list.Can there be any solutions to this?We can't expect users to check their list every time when they import something in the bot.so, can we just delete the line? Quote Link to post Share on other sites
pftg4 102 Posted August 26, 2013 Report Share Posted August 26, 2013 sure delete last list item Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.