Create a text file in KM and add the structure of a node
Hello Everybody,
could some one please advise on how do I write the data stored in my node (elements) as string into a text file? How can i create a text file and add the structure of my node to it? I can just walk through my node recursively.
Any help would be highly appreciated.
Thanks in advance.
Regards,
Seed
Are you referring to a org.w3c.dom.Node?
In that case, the simplest approach would be to use KM's XML serializer (http://help.sap.com/javadocs/NW04s/current/km/com/sapportals/wcm/util/xml/SimpleSerializer.html)
BR, Julian
Similar Messages
-
How Do I create Windows Form file in VS and add the form to my VS project?
C#, How Do I create Windows Form file in VS and add the form file to my VS project by using C# code?
I like to create a Windows Form file into my VS Win Form project by using C#. I have the path and the file name.
I need a Win Form with FileName.cs, FileName.Designer.cs, FileName.resx, and FileName (as you see it VS by adding a Win Form manually by using VS)
Rune BrattasYou cannot create a Form from code at run time.
For one thing, the user running your application will, almost certainly, not have a copy of Visual Studio to hand with which to build anything. (Not that you actually need 'Studio at all; Notepad and csc.exe are all you actually
need), but that's another story).
You can do this with an awful lot of pain, using the innards of the compiler from iside your own program, compiling the new Form's source code on the fly and then executing the resulting assembly within your application. IMHO, that's a simply terrifying
prospect especially as the code you will be compiling will be on someone else's machine and over which you will have absolutely no control. If you're lucky, they'll spell something wrong and it won't compile.
The "usual" way to do this sort of thing is to create additional, "plug-in" forms as library assemblies and have your program load and execute these at run-time.
Regards, Phill W. -
How to create a text file or XML file and add content through code into it...
Hi Everyone,
How to create a text file and add content through the code to the text file eform javascript ......orelse can we create a text file in life cycle designer...
Else say how to create a new XML file through the code and how some content like Example "Hello World".You can create a text file as a file attachment (data object) using the doc.createDataObject and doc.setDataObjectContents:
http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.450.html
http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.528.html
You can then export the file with the doc.exportDataObject method:
http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.463.html
This won't work with Reader if it hasn't been given the file attachment usage right with LiveCycle Reader Extensions. -
I was given an assingment, but have no idea where to begin. The assingment is to create a text file using notepad with all of my digital inputs and some how make those imputs show up on my digital indicators on my control pannel.
When it was explained to me it didn't sound to hard of a task, I have no LabVIEW experience and the tutortial sucks.StevenD: FYI, I did NOT give you the one star rating. I would never do that!
StevenD wrote:
Ow. Someone is grumpy today.
Well, this is an assignment, so it is probably homework.
Why else would anyone give HIM such an assigment, after all he has no LabVIEW experience and the tutorials are too hard for him?
This would make no sense unless all of it was just covered in class!
This is not a free homework service with instant gratification.
OK! Let's do it step by step. I assume you already have a VI with the digital indicators.
"...but have no idea where to begin".
open notepad.
decide on a format, possibly one line per indicator.
type the document.
close notepad.
open LabVIEW.
Open the existing VI with all the indicators.
(are you still following?)
look at the diagram.
Who made the program?
Does the code make sense so far?
Is it a statemachine or just a bunch of crisscrossed wires?
Where do you want to add the file read?
How should the file be read (after pressing a read button, at the start of the program ,etc.)
See how far you get!
Message Edited by altenbach on 06-24-2008 11:23 AM
LabVIEW Champion . Do more with less code and in less time . -
How can I add a "Create New Text File" contextual menu?
Hi,
I'd like to add a "Create New Text File" contextual item. I found the "new text file" action in Automator, but I don't really know where to go from there... I want it to work on the desktop and in finder...
ThanksSee:
Mac OS X Automation,
Automated Workflow Tips,
Introduction to Automator tutorial, and
a four-parter on Automation in Snow Leopard by Sal Saghoian:
Snow Leopard Services,
Services for iPhoto,
Safari and WebKit integration, and
Installing and using services.
Finally,
Developing AppleScript Applications and
Apple's Automator Developer Documentation -
HOw to create a text file in the given path and delete it after the use?
Hi all,
I am trying to create a text file at the given path and delete the created file after the use.
I am using following code.:
import java.io.*;
// write binary data as characters
public class RanIO {
public static void main(String f[])
// First illustrate append
String lineSep = "\n";
try {
File temp= new File("C:/Ash","cute.txt");
boolean ch=temp.createNewFile();
if(ch)
System.out.println("file created");
else
System.out.println("file Not created");
//writing to file
/* PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
p.print("Emp NO");
p.close();*/
// Open fileWriter in append mode
FileWriter fos = new FileWriter(temp, true);
BufferedWriter bw = new BufferedWriter(fos);
PrintWriter pw = new PrintWriter(fos);
double d=550;
// lineSep = System.getProperty("line.separator");
pw.print("Hello");
//pw.print( lineSep );
pw.print( d );
pw.close();
boolean det=temp.delete();
if(det)
System.out.println("File deleted");
else
System.out.println("File not deleted");
} catch (IOException ioe)
System.out.println( "Append IO error:" + ioe );
My problem:
1)
I am not able to write to the file. I want to know, where i am going wrong.
It is giving error message like
"Canot resolve Symbol: temp,"
But, FileWriter Constructor should accept a File type parameter.
here temp is a file parameter.
If i am not using file=new file();
i can't delete the file after the use. i.e if i use
PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
how can i delete cute.txt after the use?
2)
I am not able to write to the text file. file is created but, a blank file.
"Hello" is not written into the text file.
can anyone help me in this regard
Thanks in advance
AshviniThank you Ram,
But, i want to create a text file in Append mode.
for that i used
FileWriter fos = new FileWriter(temp,true); But, it is not accepting FileWriter constructor in
this format. if i use
FileWriter fos = new
FileWriter("c:/ash/cute.txt",true); it works fine. !!!!!Here's the javadoc
public FileWriter(File file,
boolean append)
throws IOExceptionConstructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
Parameters:
file - a File object to write to
append - if true, then bytes will be written to the end of the file rather than the beginning
Throws:
IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
Since:
1.4
Are you using jdk.13 or lower ?
>
ONe more doubt, Does flush method deletes a file?
if not, then i need to use
File temp=new File("c:/ash/cute.txt");
FileWriter fos = new FileWriter(temp,true); //which
is again a problem
if(temp.delete())
out.println("File is deleted");
}I don't know whether i am taking it wrong ! or
anything wrong with my coding ! but, after creating
and writing data into a text file. I must delete it
as it contains confidential informations.
Regards,
Thanks.'flush' writes to a file immediately. Else you should explicitly call 'flush' to write contents from buffer to underlying source.
javadoc again
PrintWriter
public PrintWriter(Writer out,
boolean autoFlush)Create a new PrintWriter.
Parameters:
out - A character-output stream
autoFlush - A boolean; if true, the println, printf, or format methods will flush the output buffer
cheers,
ram.
Question; What do you gain by opening a file, writing to it and deleting it in the same program ? -
ALE, IDOC - need to send IDOC and create a text file
Hi,
i need to send idoc to some other system and create a text file in that.
I want sent data to Channel Cluster.
what are the settings required for that in transactions
BD54
SCC4
SM59 - which connection is required
WE21 - which type of port
WE20 - which partner
BD64
Is there any other function modules required.
which function module is suitable like MASTER_IDOC_DISTRIBUTE.Hi,
SM59 - Use TCP/IP Connection with connection type 'T'
WE20 - Partner Name can be logical system name, if it is a vendor/customer you can configure it under the respective names.
Thanks
Krithika -
Creating links to text files with Tomcat and JSP
I am trying to create links in a JSP page that bring up text files. Currently, the links point to a file format. When the links are clicked, however, the text files are not displayed in the web browser. When an "http:" format is used, the links point to terminal files that are not being written dynamically (and therefore are useless to me). So in short, I'm looking for a way to get these links to (1) point to text files on the network, and (2) get them to display in a new browser window. Any help or guidance will be greatly appreciated.
Thanks.
TGDYou cannot expect Tomcat or any J2EE Server to give access to the Network files.
You need to design a different way to give access to the Users.
What you can do is write a proxy (HttpServlet) which can pass a request parameter as the file name. The Servlet can read the file and then paint it in the Client Browser Window.
Hope this helps.
Thanks and regards,
Pazhanikanthan. P -
How can FMS create a text file and write data into it in the Server application folders?
Recently, I writed a programe about creating a text file and writing data into it in the server application folder. My code is as following:
var fileObj = new File("/MyApp/test.txt");
if( fileObj != null)
if(fileObj.open( "text", "append"))
fileObj.write( " ———— Chat Info Backup ————\r\n" );
fileObj.close( );
trace("Chat info backup document :" + fileObj.name + " has been created successfully!");
But when I run it, FMS throw the error as following: File operation open failed ; TypeError: fileObj has no properties.
Can you help me ? Thanks in advance.
Supplement: The text file named test.txt doesn't exist before create the fileObj, an instance of File Class.Is MyApp the name of the application directory, or is it a child of the application directory? If myApp is the app name, just use test.txt as the path flag in the file constructor.
-
Not able to create a text file in Client Machine using Forms 10g
Hi - I'm mot able to create a text file in Client Machine using Forms 10g. I'm getting error when system executes the bolded line.(i.e. CLIENT_TEXT_IO.FOPEN). During run-time system is throwing "ORA-06508: PL/SQL: could not find program unit being called".
I had attached webutil.pll in the form.
Please advise me.
DECLARE
l_Temp CLIENT_TEXT_IO.FILE_TYPE;
LC$Name Varchar2(100) ;
LC$Fic Varchar2(100) ;
LN$Lines Pls_integer := 0 ;
LC$Line Varchar2(4000) ;
Cursor C_CUR Is
Select * From TEST_TEXTIO where rownum <= 50;
BEGIN
LC$Name := 'tmp_file.txt' ;
LC$Fic := 'c:\temp\tmp_file.txt';
Begin
l_temp := CLIENT_TEXT_IO.FOPEN( 'C:\temp\tmp_file.txt', 'W');
Exception
when others then
message( 'OPEN FILE ERROR ' || LC$Fic ||sqlerrm );
display_error;
raise form_trigger_failure;
End ;
-- Write the lines --
For Cur In C_CUR Loop
LC$Line := Cur.CODE || ' -> ' || Cur.COL1 || ',' || Cur.COL2 || ',' || Cur.Col3 ;
CLIENT_TEXT_IO.PUT_LINE( LF$File, LC$Line ) ;
LN$Lines := C_CUR%ROWCOUNT ;
End loop ;
-- Close the file --
CLIENT_TEXT_IO.FCLOSE( LF$File ) ;
Exception
When others Then
message('err='||sqlerrm);message(' ');
display_error;
CLIENT_TEXT_IO.FCLOSE( LF$File ) ;
Raise ;
END;
Thanks.
ArunHi ,
i have one Question though its not related to thos question if some could help me it will be really helpful,
i have created one program to import and export excel to forms vice versa, if the form is attached with webutil its working fine am using ole2.but i have a new idea if i add this program in menu, it can be used for all the forms attched to that menu, i made program also, but problem am facing right now is if the form is not attched with webutil it will not work so is there possiblity to share my webutil from one form to another form ,so i will keep one form as a interface form in that webutil will be attched ,i can share that webutil to all other forms so that all the forms no need to attach webutil again
if its possible means please suggest some ideas -
Getting error while creating a text file
Hi,
I have one macro which will write all the file names from a particular folder into a text file. However when I run it, I am getting the following error message and only last file of the identified folder is getting added in my text file.
Run Time Error '55'
File Already Open
To reproduce the scenario please add one commandbutton in your excel shhet and add the following code:
Private Sub CommandButton1_Click()
Dim p As String, x As Variant
p = "C:/*.docx"
x = GetFileList(p)
Select Case IsArray(x)
Case True 'files found
MsgBox UBound(x)
For i = LBound(x) To UBound(x)
Open "C:\temp.txt" For Output As 1
Write #1, "File Name " & x(i)
Next i
Close #1
Case False
MsgBox "No matching files"
End Select
End Sub
Function GetFileList(FileSpec As String) As Variant
Dim FileArray() As Variant
Dim FileCount As Integer
Dim FileName As String
On Error GoTo NoFilesFound
FileCount = 0
FileName = Dir(FileSpec)
If FileName = "" Then GoTo NoFilesFound
' Loop until no more matching files are found
Do While FileName <> ""
FileCount = FileCount + 1
ReDim Preserve FileArray(1 To FileCount)
FileArray(FileCount) = FileName
FileName = Dir()
Loop
GetFileList = FileArray
Exit Function
' Error handler
NoFilesFound:
GetFileList = False
End Function
'End Function
For example if I have 3 docx file(1,2,3-name of the files) in my C drive, the o/p that I want in my .txt file will be as follows.
File Name 1.docx
File Name 2.docx
File Name 3.docx
Thanks!!For i = LBound(x) To UBound(x)
Open "C:\temp.txt" For Output As 1
You call the Open method inside the FOR loop.
BTW, a collection is much more easier.
Andreas.
Private Sub CommandButton1_Click()
Dim Files As New Collection
Dim File
Dim ff As Integer
File = Dir("C:\*.docx")
Do While File <> ""
Files.Add File
File = Dir
Loop
If Files.Count = 0 Then
MsgBox "No matching files"
Exit Sub
Else
MsgBox Files.Count & " files"
End If
ff = FreeFile
Open "C:\temp.txt" For Output As #ff
For Each File In Files
Print #ff, File
Next
Close #ff
End Sub -
HI. I have itunes 10.6.1.7. When I goto movies i am not able to add and when I click on add file to library and select the file and add its not getting added. When i goto Library it says "feature films and home movies you add to itunes appear in movies in your iTunes library. To play a movie, just double click it". And below are two options for Downloading movies from store and rent movies. Please help.
I get the exactly the same problem with win 7, i rang apple support who suggested i try another machine/or create another account on my machine???? why should i, stupid ipad 3rd gen is now sitting here un syncable, apple support ....tut tut very poor support, its a shame im out of the 7 day period otherwise this ipad would be going straight back, older versions of itunes worked fine, some one must know a fix for this??
-
How to create a text file from jsp?
In JSP, what is the command to create a text file and dump a variable in it?
You mean StringBuffer?
-
hi
can anyone tell me how to create a number of text file using a different variable in java.the exact definition is like this "different variables are stored in a text file and each time it has to open this file, take these as their file name and create a text file"new File(thevariable)
-
How to Create a text file through Portal
Hi,
Is there any way to create a text file(e.g Excel file) through Portal? Thanks.
SumitaI have a way to do this in VBScript, I don't know if it will work with the portal but the steps are simple. If you can create a text file within portal, try to create it as an html table:
<table>
<tr>
<td>Column Header 1</td>
<td>Column Header 2</td>
</tr>
<tr>
<td>Value 1</td>
<td>Value 2</td>
</tr>
<tr>
</tr>
</table>
When you create this file save it with XLS extension instead of TXT, create a link to it and voila! it will load Excel and you will have your data well formatted. I found this method rather better than save the file as a CSV. You can also include any html attribute inside the <TD> or <TR> like background color and font type, Excel will keep those attributes.
I hope this will help
Arturo
Maybe you are looking for
-
NoClassDefFoundError in JBuilder
i am getting the NoClassDefFoundError ,in JBuilder, why? i am damn sure that code is correct, then why??
-
Itunes cannot recognize iphone 4
Everytime I need to do the following to connect my iphone 4 with iTunes. 1. Run command prompt as Administrator 2. Execute a command 'Netsh winsock reset' 3. Restart the system I am using Windows 7 SP1 in my laptop. iPhone is using iOS 5.0.1. Even ab
-
I KNOW HOW TO REDEEM A CARD BUT THE NEW ONE I PURCHASED KEEP STATING THAT THE PIN NUMBER IS INVALID
-
So i have a bunch of cd's from japan, korea and china that i want to import into itunes. When i try and do that, the song names and artists just show up as boxes. How do i go about displaying the characters? my default language is english. Many thank
-
DES Decryption using a decrypt id
I have a decrypt id from the vendor from whom i get the data encrypted in DES. So i wanna how i can use that decrypt id and decrypt the encrypted data. Hope someone has already worked on this and hoping for a quick reply.. Thanks, Ravi