title: How to extract data based on Index from a Dataframe
body: <p>I have a dataset and i need to extract data from a column based on the Index position</p>
  
  <p>The SERVICE_NAME column contains "ISPFSDPartnerPubSub/4_2/ProxyServices/InboundAndOutbound/AP/InboundPartnerCommunicationsAPLPPS"
  I will need to extract based on 4th and 5th Index as 'colX' and 'colY'</p>
  
  <p>How can i achieve it?</p>
  
  <pre><code>val log = spark.read.format("csv")
        .option("inferSchema", "true")
        .option("header", "true")
        .option("sep", ",")
        .option("quote", "\"")
        .option("multiLine", "true")
        .load("OSB.csv").cache()
  val logs = log.withColumn("Id", monotonicallyIncreasingId()+1)
  val df = spark.sql("select SERVICE_NAME, _raw from logs")
  </code></pre>
  
  <p>Expected Output
  Col X: AP
  Col Y: InboundPartnerCommunicationsAPLPPS</p>