M
Mmcolli00 Mom
Do you know how to create a text file with data custom positioned?
Thanks MC
Each column starts on a different position
column1 position(0)
column2 position(13)
column3 position(20)
column4 position(28)
This is an example of the way the text file should look:
SL_ewer00 45 SL_PRO1 4534 0
SL_erer 46 SL_PRO2344 46 0
SL_2344 47 SL_PRO334 47 0
#*********SNIPPPET
doc.elements.each("*//FieldMap") do |element|
@fromField = element.attributes["FromFieldID"]
@toField = element.attributes["ToFieldID"]
@fromIndex = element.attributes["FromIndex"]
@toIndex = element.attributes["ToIndex"]
File.open('C:\dRar\spn.txt', 'r+') do |f1|
f1.position 0
f1.puts @fromField
f1.seek 13
f1.puts "@toField
f1.seek 20
f1.puts @fromIndex
f1.seek 27
f1.puts @fromIndex
end
end
Thanks MC
Each column starts on a different position
column1 position(0)
column2 position(13)
column3 position(20)
column4 position(28)
This is an example of the way the text file should look:
SL_ewer00 45 SL_PRO1 4534 0
SL_erer 46 SL_PRO2344 46 0
SL_2344 47 SL_PRO334 47 0
#*********SNIPPPET
doc.elements.each("*//FieldMap") do |element|
@fromField = element.attributes["FromFieldID"]
@toField = element.attributes["ToFieldID"]
@fromIndex = element.attributes["FromIndex"]
@toIndex = element.attributes["ToIndex"]
File.open('C:\dRar\spn.txt', 'r+') do |f1|
f1.position 0
f1.puts @fromField
f1.seek 13
f1.puts "@toField
f1.seek 20
f1.puts @fromIndex
f1.seek 27
f1.puts @fromIndex
end
end