Splitting up a data String into multiple variables (Java)












0















I am working with a huge data set of about 10,500 lines that need to be split up into separate parts that include title, date, rating, and length. Here is how the data is formatted: Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m



I have already figured out how to split the data in half using .split, but I am not sure as to how to split up the first and last half of the title into the title and date when the title has parenthesis in it also, such as: Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m.



There are also instances in which some of these fields can be empty, so no rating, date or length, and those are also causing me some issues. Can anyone point me in the right direction? Any help would be appreciated!



EDIT: So I forgot to mention (sorry), I need any dates, and ratings as integers because later I will need to be able to apply filters, such as search all entries with rating > 3.5, or movies after 1998, things like that. That throws another wrench in this that I am still working with. Thank you for all the help so far!










share|improve this question

























  • 2001 (1968) - yeah I can see how that might be difficult. Good luck!

    – Elliott Frisch
    Nov 27 '18 at 0:18











  • I think the best thing to do is to never use data from where ever it is you are getting it from because any decent person would store their data in a well known format, such as CSV, JSON etc. That is, if they actually wanted someone else to use it...

    – RAZ_Muh_Taz
    Nov 27 '18 at 0:25








  • 1





    Can you add a sample of data covering all edge-cases you want?

    – mettleap
    Nov 27 '18 at 0:26











  • I guess it would be the last pair of brackets?

    – Scary Wombat
    Nov 27 '18 at 0:29











  • Can you also add the way you tried splitting it please

    – leonardkraemer
    Nov 27 '18 at 0:29
















0















I am working with a huge data set of about 10,500 lines that need to be split up into separate parts that include title, date, rating, and length. Here is how the data is formatted: Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m



I have already figured out how to split the data in half using .split, but I am not sure as to how to split up the first and last half of the title into the title and date when the title has parenthesis in it also, such as: Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m.



There are also instances in which some of these fields can be empty, so no rating, date or length, and those are also causing me some issues. Can anyone point me in the right direction? Any help would be appreciated!



EDIT: So I forgot to mention (sorry), I need any dates, and ratings as integers because later I will need to be able to apply filters, such as search all entries with rating > 3.5, or movies after 1998, things like that. That throws another wrench in this that I am still working with. Thank you for all the help so far!










share|improve this question

























  • 2001 (1968) - yeah I can see how that might be difficult. Good luck!

    – Elliott Frisch
    Nov 27 '18 at 0:18











  • I think the best thing to do is to never use data from where ever it is you are getting it from because any decent person would store their data in a well known format, such as CSV, JSON etc. That is, if they actually wanted someone else to use it...

    – RAZ_Muh_Taz
    Nov 27 '18 at 0:25








  • 1





    Can you add a sample of data covering all edge-cases you want?

    – mettleap
    Nov 27 '18 at 0:26











  • I guess it would be the last pair of brackets?

    – Scary Wombat
    Nov 27 '18 at 0:29











  • Can you also add the way you tried splitting it please

    – leonardkraemer
    Nov 27 '18 at 0:29














0












0








0








I am working with a huge data set of about 10,500 lines that need to be split up into separate parts that include title, date, rating, and length. Here is how the data is formatted: Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m



I have already figured out how to split the data in half using .split, but I am not sure as to how to split up the first and last half of the title into the title and date when the title has parenthesis in it also, such as: Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m.



There are also instances in which some of these fields can be empty, so no rating, date or length, and those are also causing me some issues. Can anyone point me in the right direction? Any help would be appreciated!



EDIT: So I forgot to mention (sorry), I need any dates, and ratings as integers because later I will need to be able to apply filters, such as search all entries with rating > 3.5, or movies after 1998, things like that. That throws another wrench in this that I am still working with. Thank you for all the help so far!










share|improve this question
















I am working with a huge data set of about 10,500 lines that need to be split up into separate parts that include title, date, rating, and length. Here is how the data is formatted: Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m



I have already figured out how to split the data in half using .split, but I am not sure as to how to split up the first and last half of the title into the title and date when the title has parenthesis in it also, such as: Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m.



There are also instances in which some of these fields can be empty, so no rating, date or length, and those are also causing me some issues. Can anyone point me in the right direction? Any help would be appreciated!



EDIT: So I forgot to mention (sorry), I need any dates, and ratings as integers because later I will need to be able to apply filters, such as search all entries with rating > 3.5, or movies after 1998, things like that. That throws another wrench in this that I am still working with. Thank you for all the help so far!







java






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 19:20







Robb Aquadro

















asked Nov 27 '18 at 0:15









Robb AquadroRobb Aquadro

12




12













  • 2001 (1968) - yeah I can see how that might be difficult. Good luck!

    – Elliott Frisch
    Nov 27 '18 at 0:18











  • I think the best thing to do is to never use data from where ever it is you are getting it from because any decent person would store their data in a well known format, such as CSV, JSON etc. That is, if they actually wanted someone else to use it...

    – RAZ_Muh_Taz
    Nov 27 '18 at 0:25








  • 1





    Can you add a sample of data covering all edge-cases you want?

    – mettleap
    Nov 27 '18 at 0:26











  • I guess it would be the last pair of brackets?

    – Scary Wombat
    Nov 27 '18 at 0:29











  • Can you also add the way you tried splitting it please

    – leonardkraemer
    Nov 27 '18 at 0:29



















  • 2001 (1968) - yeah I can see how that might be difficult. Good luck!

    – Elliott Frisch
    Nov 27 '18 at 0:18











  • I think the best thing to do is to never use data from where ever it is you are getting it from because any decent person would store their data in a well known format, such as CSV, JSON etc. That is, if they actually wanted someone else to use it...

    – RAZ_Muh_Taz
    Nov 27 '18 at 0:25








  • 1





    Can you add a sample of data covering all edge-cases you want?

    – mettleap
    Nov 27 '18 at 0:26











  • I guess it would be the last pair of brackets?

    – Scary Wombat
    Nov 27 '18 at 0:29











  • Can you also add the way you tried splitting it please

    – leonardkraemer
    Nov 27 '18 at 0:29

















2001 (1968) - yeah I can see how that might be difficult. Good luck!

– Elliott Frisch
Nov 27 '18 at 0:18





2001 (1968) - yeah I can see how that might be difficult. Good luck!

– Elliott Frisch
Nov 27 '18 at 0:18













I think the best thing to do is to never use data from where ever it is you are getting it from because any decent person would store their data in a well known format, such as CSV, JSON etc. That is, if they actually wanted someone else to use it...

– RAZ_Muh_Taz
Nov 27 '18 at 0:25







I think the best thing to do is to never use data from where ever it is you are getting it from because any decent person would store their data in a well known format, such as CSV, JSON etc. That is, if they actually wanted someone else to use it...

– RAZ_Muh_Taz
Nov 27 '18 at 0:25






1




1





Can you add a sample of data covering all edge-cases you want?

– mettleap
Nov 27 '18 at 0:26





Can you add a sample of data covering all edge-cases you want?

– mettleap
Nov 27 '18 at 0:26













I guess it would be the last pair of brackets?

– Scary Wombat
Nov 27 '18 at 0:29





I guess it would be the last pair of brackets?

– Scary Wombat
Nov 27 '18 at 0:29













Can you also add the way you tried splitting it please

– leonardkraemer
Nov 27 '18 at 0:29





Can you also add the way you tried splitting it please

– leonardkraemer
Nov 27 '18 at 0:29












2 Answers
2






active

oldest

votes


















1














Try this, tested for a couple of edge cases as shown in the comments:-



public static void main(String args) {
String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m";
//String s = "Ghost Blues: The Story of Rory Gallagher | 3.8 stars, 1hr 21m"; //no year
//String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars"; //no length
Pattern p = Pattern.compile("(.*?)( (\((\d{4})\)))? \|\s+(\d(\.\d)?) stars(, (\dhr( \d{1,2}m)?))?");
Matcher m = p.matcher(s);
if (m.find()) {
System.out.println(m.group(1)); //title
System.out.println(m.group(4)); //year
System.out.println(m.group(5)); //rating
System.out.println(m.group(8)); //length
}
}


Output



Ghost Blues: The Story of Rory Gallagher
2010
3.8
1hr 21m


Can be improved further if you can provide examples of edge cases.






share|improve this answer
























  • Nevermind, this hooman was not thinking. +1, should work.

    – Johannes H.
    Nov 27 '18 at 0:40





















0














Here's a solution:



public class Title {
private String title;
private String year;
private String rating;
private String length;
public Title(String input) {
String leftRight = input.split("\|");
title = leftRight[0].trim();
int lastParen = title.lastIndexOf("(");
if (lastParen > 0) {
year = title.substring(lastParen+1);
title = title.substring(0, lastParen).trim();
}
if (leftRight.length>1) {
String fields = leftRight[1].split(",");
for (int i = 0; i < fields.length; i++) {
if (fields[i].contains("stars")) {
rating = fields[i].trim();
} else {
length = fields[i].trim();
}
}
}
}
@Override
public String toString() {
return "Title{" + "title=" + title + ", year=" + year + ", rating=" + rating + ", length=" + length + '}';
}

public static void main(String args) {
String data = {
"Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m",
"Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m",
"just a title",
"title and rating only | 3.2 stars",
"title and length only | 1hr 30m"
};
for (String titleString : data) {
Title t = new Title(titleString);
System.out.println(t);
}
}
}


And here's the output from the test data:



Title{title=Ghost Blues: The Story of Rory Gallagher, year=2010), rating=3.8 stars, length=1hr 21m}
Title{title=Dhobi Ghat (Mumbai Diaries), year=2010), rating=3.6 stars, length=1hr 42m}
Title{title=just a title, year=null, rating=null, length=null}
Title{title=title and rating only, year=null, rating=3.2 stars, length=null}
Title{title=title and length only, year=null, rating=null, length=1hr 30m}





share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53490989%2fsplitting-up-a-data-string-into-multiple-variables-java%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Try this, tested for a couple of edge cases as shown in the comments:-



    public static void main(String args) {
    String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m";
    //String s = "Ghost Blues: The Story of Rory Gallagher | 3.8 stars, 1hr 21m"; //no year
    //String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars"; //no length
    Pattern p = Pattern.compile("(.*?)( (\((\d{4})\)))? \|\s+(\d(\.\d)?) stars(, (\dhr( \d{1,2}m)?))?");
    Matcher m = p.matcher(s);
    if (m.find()) {
    System.out.println(m.group(1)); //title
    System.out.println(m.group(4)); //year
    System.out.println(m.group(5)); //rating
    System.out.println(m.group(8)); //length
    }
    }


    Output



    Ghost Blues: The Story of Rory Gallagher
    2010
    3.8
    1hr 21m


    Can be improved further if you can provide examples of edge cases.






    share|improve this answer
























    • Nevermind, this hooman was not thinking. +1, should work.

      – Johannes H.
      Nov 27 '18 at 0:40


















    1














    Try this, tested for a couple of edge cases as shown in the comments:-



    public static void main(String args) {
    String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m";
    //String s = "Ghost Blues: The Story of Rory Gallagher | 3.8 stars, 1hr 21m"; //no year
    //String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars"; //no length
    Pattern p = Pattern.compile("(.*?)( (\((\d{4})\)))? \|\s+(\d(\.\d)?) stars(, (\dhr( \d{1,2}m)?))?");
    Matcher m = p.matcher(s);
    if (m.find()) {
    System.out.println(m.group(1)); //title
    System.out.println(m.group(4)); //year
    System.out.println(m.group(5)); //rating
    System.out.println(m.group(8)); //length
    }
    }


    Output



    Ghost Blues: The Story of Rory Gallagher
    2010
    3.8
    1hr 21m


    Can be improved further if you can provide examples of edge cases.






    share|improve this answer
























    • Nevermind, this hooman was not thinking. +1, should work.

      – Johannes H.
      Nov 27 '18 at 0:40
















    1












    1








    1







    Try this, tested for a couple of edge cases as shown in the comments:-



    public static void main(String args) {
    String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m";
    //String s = "Ghost Blues: The Story of Rory Gallagher | 3.8 stars, 1hr 21m"; //no year
    //String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars"; //no length
    Pattern p = Pattern.compile("(.*?)( (\((\d{4})\)))? \|\s+(\d(\.\d)?) stars(, (\dhr( \d{1,2}m)?))?");
    Matcher m = p.matcher(s);
    if (m.find()) {
    System.out.println(m.group(1)); //title
    System.out.println(m.group(4)); //year
    System.out.println(m.group(5)); //rating
    System.out.println(m.group(8)); //length
    }
    }


    Output



    Ghost Blues: The Story of Rory Gallagher
    2010
    3.8
    1hr 21m


    Can be improved further if you can provide examples of edge cases.






    share|improve this answer













    Try this, tested for a couple of edge cases as shown in the comments:-



    public static void main(String args) {
    String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m";
    //String s = "Ghost Blues: The Story of Rory Gallagher | 3.8 stars, 1hr 21m"; //no year
    //String s = "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars"; //no length
    Pattern p = Pattern.compile("(.*?)( (\((\d{4})\)))? \|\s+(\d(\.\d)?) stars(, (\dhr( \d{1,2}m)?))?");
    Matcher m = p.matcher(s);
    if (m.find()) {
    System.out.println(m.group(1)); //title
    System.out.println(m.group(4)); //year
    System.out.println(m.group(5)); //rating
    System.out.println(m.group(8)); //length
    }
    }


    Output



    Ghost Blues: The Story of Rory Gallagher
    2010
    3.8
    1hr 21m


    Can be improved further if you can provide examples of edge cases.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 27 '18 at 0:37









    KartikKartik

    3,75731435




    3,75731435













    • Nevermind, this hooman was not thinking. +1, should work.

      – Johannes H.
      Nov 27 '18 at 0:40





















    • Nevermind, this hooman was not thinking. +1, should work.

      – Johannes H.
      Nov 27 '18 at 0:40



















    Nevermind, this hooman was not thinking. +1, should work.

    – Johannes H.
    Nov 27 '18 at 0:40







    Nevermind, this hooman was not thinking. +1, should work.

    – Johannes H.
    Nov 27 '18 at 0:40















    0














    Here's a solution:



    public class Title {
    private String title;
    private String year;
    private String rating;
    private String length;
    public Title(String input) {
    String leftRight = input.split("\|");
    title = leftRight[0].trim();
    int lastParen = title.lastIndexOf("(");
    if (lastParen > 0) {
    year = title.substring(lastParen+1);
    title = title.substring(0, lastParen).trim();
    }
    if (leftRight.length>1) {
    String fields = leftRight[1].split(",");
    for (int i = 0; i < fields.length; i++) {
    if (fields[i].contains("stars")) {
    rating = fields[i].trim();
    } else {
    length = fields[i].trim();
    }
    }
    }
    }
    @Override
    public String toString() {
    return "Title{" + "title=" + title + ", year=" + year + ", rating=" + rating + ", length=" + length + '}';
    }

    public static void main(String args) {
    String data = {
    "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m",
    "Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m",
    "just a title",
    "title and rating only | 3.2 stars",
    "title and length only | 1hr 30m"
    };
    for (String titleString : data) {
    Title t = new Title(titleString);
    System.out.println(t);
    }
    }
    }


    And here's the output from the test data:



    Title{title=Ghost Blues: The Story of Rory Gallagher, year=2010), rating=3.8 stars, length=1hr 21m}
    Title{title=Dhobi Ghat (Mumbai Diaries), year=2010), rating=3.6 stars, length=1hr 42m}
    Title{title=just a title, year=null, rating=null, length=null}
    Title{title=title and rating only, year=null, rating=3.2 stars, length=null}
    Title{title=title and length only, year=null, rating=null, length=1hr 30m}





    share|improve this answer






























      0














      Here's a solution:



      public class Title {
      private String title;
      private String year;
      private String rating;
      private String length;
      public Title(String input) {
      String leftRight = input.split("\|");
      title = leftRight[0].trim();
      int lastParen = title.lastIndexOf("(");
      if (lastParen > 0) {
      year = title.substring(lastParen+1);
      title = title.substring(0, lastParen).trim();
      }
      if (leftRight.length>1) {
      String fields = leftRight[1].split(",");
      for (int i = 0; i < fields.length; i++) {
      if (fields[i].contains("stars")) {
      rating = fields[i].trim();
      } else {
      length = fields[i].trim();
      }
      }
      }
      }
      @Override
      public String toString() {
      return "Title{" + "title=" + title + ", year=" + year + ", rating=" + rating + ", length=" + length + '}';
      }

      public static void main(String args) {
      String data = {
      "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m",
      "Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m",
      "just a title",
      "title and rating only | 3.2 stars",
      "title and length only | 1hr 30m"
      };
      for (String titleString : data) {
      Title t = new Title(titleString);
      System.out.println(t);
      }
      }
      }


      And here's the output from the test data:



      Title{title=Ghost Blues: The Story of Rory Gallagher, year=2010), rating=3.8 stars, length=1hr 21m}
      Title{title=Dhobi Ghat (Mumbai Diaries), year=2010), rating=3.6 stars, length=1hr 42m}
      Title{title=just a title, year=null, rating=null, length=null}
      Title{title=title and rating only, year=null, rating=3.2 stars, length=null}
      Title{title=title and length only, year=null, rating=null, length=1hr 30m}





      share|improve this answer




























        0












        0








        0







        Here's a solution:



        public class Title {
        private String title;
        private String year;
        private String rating;
        private String length;
        public Title(String input) {
        String leftRight = input.split("\|");
        title = leftRight[0].trim();
        int lastParen = title.lastIndexOf("(");
        if (lastParen > 0) {
        year = title.substring(lastParen+1);
        title = title.substring(0, lastParen).trim();
        }
        if (leftRight.length>1) {
        String fields = leftRight[1].split(",");
        for (int i = 0; i < fields.length; i++) {
        if (fields[i].contains("stars")) {
        rating = fields[i].trim();
        } else {
        length = fields[i].trim();
        }
        }
        }
        }
        @Override
        public String toString() {
        return "Title{" + "title=" + title + ", year=" + year + ", rating=" + rating + ", length=" + length + '}';
        }

        public static void main(String args) {
        String data = {
        "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m",
        "Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m",
        "just a title",
        "title and rating only | 3.2 stars",
        "title and length only | 1hr 30m"
        };
        for (String titleString : data) {
        Title t = new Title(titleString);
        System.out.println(t);
        }
        }
        }


        And here's the output from the test data:



        Title{title=Ghost Blues: The Story of Rory Gallagher, year=2010), rating=3.8 stars, length=1hr 21m}
        Title{title=Dhobi Ghat (Mumbai Diaries), year=2010), rating=3.6 stars, length=1hr 42m}
        Title{title=just a title, year=null, rating=null, length=null}
        Title{title=title and rating only, year=null, rating=3.2 stars, length=null}
        Title{title=title and length only, year=null, rating=null, length=1hr 30m}





        share|improve this answer















        Here's a solution:



        public class Title {
        private String title;
        private String year;
        private String rating;
        private String length;
        public Title(String input) {
        String leftRight = input.split("\|");
        title = leftRight[0].trim();
        int lastParen = title.lastIndexOf("(");
        if (lastParen > 0) {
        year = title.substring(lastParen+1);
        title = title.substring(0, lastParen).trim();
        }
        if (leftRight.length>1) {
        String fields = leftRight[1].split(",");
        for (int i = 0; i < fields.length; i++) {
        if (fields[i].contains("stars")) {
        rating = fields[i].trim();
        } else {
        length = fields[i].trim();
        }
        }
        }
        }
        @Override
        public String toString() {
        return "Title{" + "title=" + title + ", year=" + year + ", rating=" + rating + ", length=" + length + '}';
        }

        public static void main(String args) {
        String data = {
        "Ghost Blues: The Story of Rory Gallagher (2010) | 3.8 stars, 1hr 21m",
        "Dhobi Ghat (Mumbai Diaries) (2010) | 3.6 stars, 1hr 42m",
        "just a title",
        "title and rating only | 3.2 stars",
        "title and length only | 1hr 30m"
        };
        for (String titleString : data) {
        Title t = new Title(titleString);
        System.out.println(t);
        }
        }
        }


        And here's the output from the test data:



        Title{title=Ghost Blues: The Story of Rory Gallagher, year=2010), rating=3.8 stars, length=1hr 21m}
        Title{title=Dhobi Ghat (Mumbai Diaries), year=2010), rating=3.6 stars, length=1hr 42m}
        Title{title=just a title, year=null, rating=null, length=null}
        Title{title=title and rating only, year=null, rating=3.2 stars, length=null}
        Title{title=title and length only, year=null, rating=null, length=1hr 30m}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 27 '18 at 0:47

























        answered Nov 27 '18 at 0:38









        Tom DrakeTom Drake

        43738




        43738






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53490989%2fsplitting-up-a-data-string-into-multiple-variables-java%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)