Skip to content

Instantly share code, notes, and snippets.

View anupamshakya7's full-sized avatar

anupamshakya7

View GitHub Profile
@anupamshakya7
anupamshakya7 / Merge_CSV.py
Last active August 29, 2015 14:02
Merge two CSV into new with ID as a common in the headers part
import csv
import os
if __name__ == '__main__':
"""This script will merge two CSV with common data as per the ID as a field
into new CSV.
::NOTE:: This program tested on 2.7.6 version of python.
@anupamshakya7
anupamshakya7 / CSV
Created June 10, 2014 08:47
Merge two CSV with common field.
INPUT1
======
ID,name,add
1,anupam,FHG
2,aditya,DFR
3,urmila,HJTY
4,roop,GHG
5,EASH,HJJ
INPUT2
@anupamshakya7
anupamshakya7 / Transformation_From_XSLT
Created April 25, 2014 11:11
How to transform an XML file using XSLT in Python
from lxml import etree
data = open('D:\Conversion\MACSXML_Parts.xslt')
xslt_content = data.read()
xslt_root = etree.XML(xslt_content)
dom = etree.parse('D:\Conversion\Cat2015UF.xml')
transform = etree.XSLT(xslt_root)
result = transform(dom)
f = open('D:\Conversion\MACSXML_Parts.csv', 'w')
f.write(str(result1))
curl -XDELETE localhost:9200/test-idx
echo
curl -XPUT localhost:9200/test-idx -d '{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0,
"analysis": {
"analyzer": {
"query_default": {