title: 'list' object has no attribute 'map'
body: <p>I do know it's cause that <code>map</code> is a function and not a method of list. But is there a way I can use the map function to pass data to the function called inside map. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>def func1(lines):
      global newlst
      for line in lines:
          qtype = re.search("qtype=(\S+)",str(line))  
          ......
  file = sc.textFile("C:\\TestLogs\\sample.log").cache()
  result = file.map(lambda x: x.split("\n")).collect()
  print(type(result)) #it is a list
  lines = result.map(func1).collect() #I want to pass the contents of result to func1 through map function.
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>    lines = result.map(func1).collect()
  AttributeError: 'list' object has no attribute 'map'
  </code></pre>
  
  <p>Is there any other way I can pass my data from <code>results</code> to <code>func1</code> but by using <code>map</code> or any concept in spark that generates an rdd?</p>