Created
January 19, 2019 18:38
-
-
Save ysnerdem/b09cdc776d1303fed68f2c97d3a1b88f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doc = File.open("/home/yasin/İndirilenler/Satıs_Faturaları.XML") | |
count = 0 | |
# doc.each do |line| | |
# count += 1 if line.include?("<INVOICE DBOP=\"INS\" >") | |
# break if count == 5001 | |
# File.open("1.xml", "a") { |f| f.write(line.to_s) } | |
# end | |
# | |
# File.open("1.xml", "a") { |f| f.write("</SALES_INVOICES>") } | |
# ****** 2 | |
# File.open("2.xml", "a") { |f| f.write("<?xml version=\"1.0\" encoding=\"ISO-8859-9\"?>\n") } | |
# File.open("2.xml", "a") { |f| f.write("<SALES_INVOICES>\n") } | |
# | |
# doc.each do |line| | |
# count += 1 if line.include?("<INVOICE DBOP=\"INS\" >") | |
# break if count == 10001 | |
# if count >= 5001 | |
# File.open("2.xml", "a") { |f| f.write(line.to_s) } | |
# end | |
# end | |
# | |
# File.open("2.xml", "a") { |f| f.write("</SALES_INVOICES>") } | |
# ***** 3 | |
# File.open("3.xml", "a") { |f| f.write("<?xml version=\"1.0\" encoding=\"ISO-8859-9\"?>\n") } | |
# File.open("3.xml", "a") { |f| f.write("<SALES_INVOICES>\n") } | |
# | |
# doc.each do |line| | |
# count += 1 if line.include?("<INVOICE DBOP=\"INS\" >") | |
# break if count == 15001 | |
# if count >= 10001 | |
# File.open("3.xml", "a") { |f| f.write(line.to_s) } | |
# end | |
# end | |
# | |
# File.open("3.xml", "a") { |f| f.write("</SALES_INVOICES>") } | |
# ***** 4 | |
# File.open("4.xml", "a") { |f| f.write("<?xml version=\"1.0\" encoding=\"ISO-8859-9\"?>\n") } | |
# File.open("4.xml", "a") { |f| f.write("<SALES_INVOICES>\n") } | |
# | |
# doc.each do |line| | |
# count += 1 if line.include?("<INVOICE DBOP=\"INS\" >") | |
# break if count == 20001 | |
# if count >= 15001 | |
# File.open("4.xml", "a") { |f| f.write(line.to_s) } | |
# end | |
# end | |
# | |
# File.open("4.xml", "a") { |f| f.write("</SALES_INVOICES>") } | |
# ***** 5 | |
File.open("5.xml", "a") { |f| f.write("<?xml version=\"1.0\" encoding=\"ISO-8859-9\"?>\n") } | |
File.open("5.xml", "a") { |f| f.write("<SALES_INVOICES>\n") } | |
doc.each do |line| | |
count += 1 if line.include?("<INVOICE DBOP=\"INS\" >") | |
break if count == 21278 | |
if count >= 20001 | |
File.open("5.xml", "a") { |f| f.write(line.to_s) } | |
end | |
end | |
doc. |
canozel
commented
Jan 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment