monica1
21st June 2005, 17:15
How can I transfer a text that i have in MSWord or in excel to a text field in baan? I need something more or less automatic because i have 20.000 text to transfer.
Thank you in advance,
mark_h
21st June 2005, 20:32
Is this 20,000 documents or 20,000 lines? Maybe more input as to what is required will help others provide a solution. Is this all one set of text? Or is text for multiple different places.
I would recommend writing a macro to save all the word documents as plain text files. You could use client2server to move the file to the server,then use the text.to.buf to put the current text to a file, append/merge the two text files, and then use text.rewrite to load the text back into Baan.
Just a thought!
beginer
22nd June 2005, 09:20
Hi ,
U can open the main file which has all the texts in read mode.
Read the text one by one ( i.e All the lines required to be put in one text at a time ) & write it to a temporary file.
Use seq.open() , seq.get() , seq.write() , seq.close() etc. functions for this.
Then use text.write() function to write the text in BaaN.
Usage :-
Eg.
text.write("tdpur400.txta","2","", "", "","","", "","tmptxt")
First field is the BaaN Text field.
Second the language.
Then are the 4 Keywords ( C maintain texts u will understand better )
Last argument is the name of file which contains the actual text.
This function uses a file as input.Data in this file is uploaded as text.
monica1
23rd June 2005, 13:02
Finally I did that:
I have the documents in MSWord and in EXCEL. A line for each document.
1º) I created a table in Baan with 2 fields: the code and a string field
2º) The excel document I add a new columm filled up with a {. I save as .txt with tabs.
3º) The file I open with a Hexadecimal editor.
4º) I change the code 0D and 0A (thas was the return code) to @@ (that was a simbol that in the text is never use)
5º) The simbol { I change to 0A.
6º) I open again the file .txt with exel and I save as .csv
7º) I tranfer the .csv file to my new table in Baan
8º) I write a program to create texts from the string field. I read each character from my string and if I find @@ I make a seq.put in a temp file.
The temp file obten I use to create the text.
Thank you very much for your reply,