Jump to content
UBot Underground

List from CSV file always adds one extra empty line, why?


Recommended Posts

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")
Link to post
Share on other sites

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.

Link to post
Share on other sites

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 by daveconor
Link to post
Share on other sites

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)

Link to post
Share on other sites

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.

Link to post
Share on other sites

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?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...