PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, July 19, 2022

[FIXED] How to split an integer using cypher Ne04j

 July 19, 2022     cypher, integer, neo4j, split     No comments   

Issue

I have been trying to split the Half-time as I only require one of the two digits.

CSV file:

Round,Date,Team1,FT,HT,Team2
1,(Sat) 12 Aug 2017 (32),Chelsea FC,2-3,0-3,Burnley FC
1,(Sat) 12 Aug 2017 (32),Crystal Palace FC,0-3,0-2,Huddersfield Town AFC

LOAD CSV FROM WITH HEADERS "file:///epl_mataches.csv" AS row 
CREATE (t:team1{RoundtoInteger(row.Round), date:row.date, Team1:row.Team1,
FT:split(row.FT), HT:row.HT})

thank you


Solution

The result of the split function is a list. To get the first item on a list, you use the index 0.

 RETURN split('2-3', '-')[0]

 Result:  2

So in your query, use FT:split(row.FT, '-')[0]



Answered By - jose_bacoy
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing