Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6880255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:57:03+00:00 2026-05-27T04:57:03+00:00

I have sticky point with a list. After some work I could generate my

  • 0

I have sticky point with a list. After some work I could generate my list and make an xml result.
But in my list are entries with tabulators or line breaks (the last entry)

If I execute the script, the result is the following:

[100, 0100045395, Kurzstrasse, 0502028767496, , 8050, 100, Zürich, 05.07.2010, 
100, 0100045395, 0400053113, 0000356988, , TPS, ZL1, 1549820, 02.06.2010, 
100, 0100045395, 0400053113, 0000356988, , TPS, ZL1, 1549820, 02.06.2010, 
]

First of all I will try to remove the last line break with pop()
But I allways get this message:

Caught: groovy.lang.MissingMethodException: No signature of method:   Ljava.lang.String;.pop() is applicable for argument types: () values: []
    Possible solutions: sum(), dump(), min(), max(), any(), sort()
       at auslesenzwei.xmlGenerieren(auslesenzwei.groovy:44)
        at auslesenzwei.run(auslesenzwei.groovy:37)

What I’am doing wrong?

Code:

 import groovy.util.CharsetToolkit;
 import java.lang.Object

 //Generate pathname
 //Pfadname generiert für einfacheres ändern des Speicherortes
 def pathname = "C:/mySupport-eclipse/trackandtrace.txt"
 //Define Error Status
 //Error Status definieren für Weiterverabeitung in mySupport
 int errorCode = 0
 def errorMessage = ""

 def linesAsList = []


 def bsknr = "0100045395"
 //Define new File
 //Neue Datei definieren
 def file = new File(pathname)

 if(!file.exists())
{
    errorCode = 1
    errorMessage = "File not found"
    out_xml = xmlGenerieren()   
}
else
{
    //Read Roews and look for BSK Number, split after tab
    //Zeilen einlesen und nach der BSK Nummer suchen, nach dem Tabulator trennen
    def lines = file.filterLine { 
        line -> line ==~ /.*\t${bsknr}\t.*/ 

        }
    //Split the result after tab and enter, give back as String
    //Das Ergebnis aufteilen bei Tabulator und Enter und zugleich als String zurückgeben
    linesAsList = lines.toString().split('\t|\r')
    xmlGenerieren(linesAsList)
        //println linesAsList
    }

 def xmlGenerieren(givenlist) {
     def writer = new StringWriter()
     def builder = new groovy.xml.MarkupBuilder(writer)
        //givenlist.pop()
     println givenlist
     def listsize = givenlist.size()


    //Test if is empty
//Prüfen ob ein Ergebnis gefunden wurde
if (listsize == 0)
{
    builder.result() 
    {
        entry(wert:"0")
        {
            paketnr("(empty)")
        }
    }
    println writer.toString()
    errorCode = 0
    }
else {


//i = listsize / 8
//println i

}

}

thanks for the help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:57:04+00:00Added an answer on May 27, 2026 at 4:57 am

    String.split() returns an array of Strings, not a List. Use String.tokenize(), or cast the result of split to a list like linesAsList = lines.toString().split('\t|\r') as List.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to make a sticky footer i have tried on google found some results
Hi I have a Sticky form that after successful completion I want to clear
I have recently run into a particularly sticky issue regarding committing the result of
I have tried to implement css sticky footer on my page but it doesn't
I have an IntentService and I want to make it sticky with an ongoing
I have a sticky div but I need it to stop at a certain
I have a file in cvs that has Sticky Options set to -kk .
I have made a rediculasly small snippet to make a sub-header stick to the
I have the following html where I use the jquery after method() to stick
I've run into a rather sticky situation and I was hoping you all could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.