How to re-write a file
hi
how can ı re write a file without loosing before ı wrote
ı mean that
in program ı wrote something in a file
later ı want to add something in file again
Use FileWritter with append true.
But yoy know your question is not exactly about algorithm don't you?
Similar Messages
-
How do you write a file involving the changes in application engine?
Hi Guys,
I have a requirement in app engine.
I have to update a table based on the changes occured in other tables.
I have to show the user old value and new updated value in the log file how do I write a file for below fields?
Old Value: Name:Rock|SSN:0000000|Address:675478
New Value Name: Roger|SSN:0000000|Address:908765
Thanks and regards,Hi ,
My Requirement is Quite different here.
I cannot use CI.i have to implement in app engine.
Below explained:
I have data coming from abc table and populating into xyz table.
So if any field in abc gets changed which is extracted and populated in the xyz table.I have to show the old field value of xyz and the new field values of abc which I am going to insert into the xyz.
My log file should have both the values.
how do I write both the values and update it:
say I have value from abc.id=12 and xyz.id=12
when we update abc.id=13 and xyz.id=14
I have to print
old record details:
id=12
New record details:
id=13
somerthing of above sort
Thanks and Regards -
How can i write properties file for Hindi font
Hi All,
i'm using jdev 11.1.1.5.0
in my use case i have worked on internationalization where i want to use hindi font
like this link -
Majid Hussain: Internationalization of ADF 11.1.1.3 Applications
as in above post majid used german language and write properties file for german language(which is using english character).
but my problem is that i want to use hindi language
so how can i write propery file which support hindi font.
ManishHi Manish,
We also had same requirement where we need to show indian local language(Hindi ,Bengali and many more ).
We had implemented following approach and perhaps it will helpful for you.
1-First we changed the encoding value in jdeveloper.
go to jdeveloper --> tools --->preference-->encoding , select to UTF8
2-We used to get the properties and it's translated value from business and then we were manually put these pair into related resource bundle.
And using this we were able to implemented multilanguage support.
Thanks
Prateek -
How can I write a file and fill it in periods?
Hi Every body!
I need help with this.
I have my aplication(power quality analiser),This VI obtain several varibles and make a lot of calculus and operation, to obtein others parameters in real time so my problem is Save the acquire data and calculus data into a file (similar as a report) every period(custumizable for the user in time units)
I mean make a only one file wich is write every period continuously , e.g. Start my principal VI and this event start the write of file, past one period,make other row or colum into the same file and continue that way until we stop the principal VI.
How can I make that?
Thaks very much
Best RegardsHi,
assuming you have your trigger (notifier or just periodically) you can append the data to a single record.
Open the file, set the file position to the end, write the data and close the file.
Hope this helps -
Hello,
I am acquirng a continous 4-20mA using DAQmx read. How can I write the data acquired as excel file, can some explain how to use the write labview measure file function, or is there any better way of writing using some DAQmx write?
My acquisition is from 6 channels, so I would like all 6 readings to be written.
Thanks
YemiHi,
Also, to find example code, go to "Help" >> "Find example..." and search for "excel" if you want to write data to Excel document or search for "spreadsheet" if you want to write data to tabulated text documents.
Hope this help
When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!" -
How to read/write .CSV file into CLOB column in a table of Oracle 10g
I have a requirement which is nothing but a table has two column
create table emp_data (empid number, report clob)
Here REPORT column is CLOB data type which used to load the data from the .csv file.
The requirement here is
1) How to load data from .CSV file into CLOB column along with empid using DBMS_lob utility
2) How to read report columns which should return all the columns present in the .CSV file (dynamically because every csv file may have different number of columns) along with the primariy key empid).
eg: empid report_field1 report_field2
1 x y
Any help would be appreciated.If I understand you right, you want each row in your table to contain an emp_id and the complete text of a multi-record .csv file.
It's not clear how you relate emp_id to the appropriate file to be read. Is the emp_id stored in the csv file?
To read the file, you can use functions from [UTL_FILE|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#BABGGEDF] (as long as the file is in a directory accessible to the Oracle server):
declare
lt_report_clob CLOB;
l_max_line_length integer := 1024; -- set as high as the longest line in your file
l_infile UTL_FILE.file_type;
l_buffer varchar2(1024);
l_emp_id report_table.emp_id%type := 123; -- not clear where emp_id comes from
l_filename varchar2(200) := 'my_file_name.csv'; -- get this from somewhere
begin
-- open the file; we assume an Oracle directory has already been created
l_infile := utl_file.fopen('CSV_DIRECTORY', l_filename, 'r', l_max_line_length);
-- initialise the empty clob
dbms_lob.createtemporary(lt_report_clob, TRUE, DBMS_LOB.session);
loop
begin
utl_file.get_line(l_infile, l_buffer);
dbms_lob.append(lt_report_clob, l_buffer);
exception
when no_data_found then
exit;
end;
end loop;
insert into report_table (emp_id, report)
values (l_emp_id, lt_report_clob);
-- free the temporary lob
dbms_lob.freetemporary(lt_report_clob);
-- close the file
UTL_FILE.fclose(l_infile);
end;This simple line-by-line approach is easy to understand, and gives you an opportunity (if you want) to take each line in the file and transform it (for example, you could transform it into a nested table, or into XML). However it can be rather slow if there are many records in the csv file - the lob_append operation is not particularly efficient. I was able to improve the efficiency by caching the lines in a VARCHAR2 up to a maximum cache size, and only then appending to the LOB - see [three posts on my blog|http://preferisco.blogspot.com/search/label/lob].
There is at least one other possibility:
- you could use [DBMS_LOB.loadclobfromfile|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i998978]. I've not tried this before myself, but I think the procedure is described [here in the 9i docs|http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl12bfl.htm#879711]. This is likely to be faster than UTL_FILE (because it is all happening in the underlying DBMS_LOB package, possibly in a native way).
That's all for now. I haven't yet answered your question on how to report data back out of the CLOB. I would like to know how you associate employees with files; what happens if there is > 1 file per employee, etc.
HTH
Regards Nigel
Edited by: nthomas on Mar 2, 2009 11:22 AM - don't forget to fclose the file... -
How to over write a file on server using Dataset
Hello Experts,
Iu2019ve trying to write a code to fetch data in my program and create a file on server. My program work fine. However every time I run my program it append data at the end of the tile which it created 1st time. I donu2019t want this to happen. I want to new record to print on this file or in other words I want it to over write the file. Here is my code of dataset part.
open dataset file for appending in text mode encoding default.
if sy-subrc ne 0.
write:/ 'File Opening/Creation Error'.
exit.
endif.
loop at ivbrk.
clear record.
move ivbrk-headr to record+1(1).
move ivbrk-vbeln to record+3(10).
move ivbrk-waerk to record+15(5).
move ivbrk-knumv to record+22(10).
move ivbrk-fkdat to record+34(8).
move ivbrk-kunrg to record+43(10).
move ivbrk-kunag to record+54(10).
transfer record to file.
loop at ivbrp where vbeln = ivbrp-vbeln.
clear items.
move ivbrp-items to items+1(1).
move ivbrp-posnr to items+3(6).
move ivbrp-fkimg to items+11(13).
move ivbrp-vrkme to items+25(3).
move ivbrp-meins to items+30(3).
move ivbrp-ntgew to items+34(15).
move ivbrp-brgew to items+50(15).
move ivbrp-gewei to items+66(3).
transfer items to file.
endloop.
endloop.
close dataset file.
Can please somebody tell me what change I should make to over write on this file?
Thanks a lot in advance.
Moderator message - Please use code tags around your code
Edited by: Rob Burbank on Jan 12, 2010 5:08 PMHey zero:
open dataset file for appending in text mode encoding default.
Probably because you're opening it for appending.
Rob -
How can I write to files from applets?
I want to write a capability into a game i'm writing that allows it to keep track of high scores. I am fairly certain that I will need to write to a file separate from the applet and then read it back in later. How can I do this? I don't think typical input/output streams work. Any helps or tips on how to set up a high scores list would be helpful!
thanks a lot!Hi,
Firts sign the applet or jar file.
public void NxFileOpen(String ElFichero) {
String ElError="";
NxExportarPath=ElFichero;
try {
NxExportarFile = new FileWriter(ElFichero,false);
} catch (IOException NxError) {
ElError="No puedo abrir el fichero :"+NxExportarPath+".";
} catch (SecurityException NxError) {
ElError="No puedo acceder al fichero :"+NxExportarPath+ " para abrir. (Seguridades java)";
} catch (Exception NxError) {
ElError="Error. Fichero = "+NxExportarPath+". Accion = OPEN.";
if (ElError!="") {
System.out.println(ElError);
NxExportarFile = null;
public void NxFileClose() {
String ElError="";
try {
NxExportarFile.close();
} catch (IOException NxError) {
ElError="No puedo cerrar el fichero :"+NxExportarPath+".";
} catch (SecurityException NxError) {
ElError="No puedo acceder al fichero :"+NxExportarPath+ " para cerrar.(Seguridades java)";
} catch (Exception NxError) {
ElError="Error. Fichero = "+NxExportarPath+". Accion = CLOSE.";
if (ElError!="") {
System.out.println(ElError);
NxExportarFile = null;
public void NxFileSave(int Dato) {
String ElError="";
try {
NxExportarFile.write(Dato);
} catch (IOException NxError) {
ElError="No puedo grabar en el fichero :"+NxExportarPath+".";
} catch (SecurityException NxError) {
ElError="No puedo acceder al fichero :"+NxExportarPath+ " para grabar. (Seguridades java)";
} catch (Exception NxError) {
ElError="Error. Fichero = "+NxExportarPath+". Accion = WRITE.";
if (ElError!="") {
System.out.println(ElError);
NxExportarFile = null;
I hope help you -
How can read & write .ncd files?
I need to create / modify a .ncd file (used in Max 3.0.2) for can channel configuration. How can I do that in C or VB?
Giuliano,
if you try to open the .ncd file with Notepad it states it is an XML 1.0 file. Actually, if you open it up with MS Internet Explorer you should be able to see exactly the same structure you see in MAX.
So, if you want to modify and/or create the .ncd file externally you can use a text editor or an XML parser to write your .ncd files and then load the messages from MAX.
Greetings
AlessioD
National Instruments -
How can I write log file???
Hi every body.
I have a project built by ADF BC. I want that when user performs INSERT, UPDATE, DELETE,... into DB from client tier in some form, before performing those queries I will get the user information (who login the system) and write out a log file about that user from that information in each entity influenced by the user.
How can I do this???I understand what you mean from your link. But the question I meant is not that. What I meant is that, I can get the user information (user_name,password,...) who performs the queries to DB and write those information to log file.
Thanks. -
How to manually write log file when tranform xslt by using Transformer?
I want to ask experts that are there any way to write the information(such as template name or number of template used) into log file while performing transformation with javax.xml.transform.Transformer.
Below is my sample code
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
// declare and assign value of transform, source, and result
transformer.transform(source, result);
Thanks for advanceI think it will be from FDM, if I remember correctly FDM will generate a text file in the background and then load data into essbase using the text file.
The codes at each line are standard essbase generated codes which relate to an operation e.g. 1013162 = Received Command [Calculate] from user [%s] using [%s]
If you have a search on the web you will be able to find a full list of codes from numerous locations.
Cheers
John
http://john-goodwin.blogspot.com/ -
How to read/write local file in lync silverlight application?
I tried doing that by various method but an exception pop-ups. My lync silverlight application works fine in browser or out of browser (with elevated permissions) but when I try to do so in lync's window extension (CWE) is throws an exception saying "File
operation not permitted. Access to path '<some path>' is denied". Please help!
private void button1_Click(object sender, RoutedEventArgs e)
try
if (!string.IsNullOrEmpty(textBox1.Text))
string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "abc.txt");
StreamWriter writer = File.CreateText(path);
writer.Write(textBox1.Text);
writer.Close();
catch (Exception ee)
MessageBox.Show(ee.Data + "\n\n" + ee.Message);Hi,
You might post the issue on Lync MSDN forum and more developing expert will help you with Lync SDK. Thank you for your understanding.
http://social.msdn.microsoft.com/Forums/en-US/communicatorsdk/threads
Best Regards,
Eason Huang
Eason Huang
TechNet Community Support -
How do I write to file at a discrete time step?
I'm writing some variables out to a binary file in real-time (xpos, ypos, elapsed time) with a while loop (see blockdiag.png). I'm using the time recorded by LabVIEW with an external devices clock to interpolate position values, before you ask, I don't have access to the external clock so interpolation is necessary after the data has been collected. Currently, the while loop is unabated and runs as fast as the CPU will let it. After I'm done collecting my data, I plotted up the elapsed time in MATLAB and noticed some very strange behavior, negative time (see clocks.png)!!!! The black data here is my external devices clock and the red data represents the elapsed time written out by LabVIEW. There are two instances in the vector that indicate a large negative step in time. This doesn't always happen and seems to occur somewhat spontaneously within the elapsed time vector.
Questions:
1) Has anyone seen this behavior before?
2) Would putting a Wait.vi in the while loop help? (I figured this would at least regularize the time step.)
3) Please help.
Much thanks, please don't judge my LabVIEW code (I'm sure there are better ways to do it, but it works and that is how I want it).
Adam
Solved!
Go to Solution.
Attachments:
blockdiag.png 302 KB
clocks.png 12 KBAdamBlues wrote:
Much thanks, please don't judge my LabVIEW code (I'm sure there are better ways to do it, but it works and that is how I want it).
Adam
I just wanted to make a brief comment regarding the above statement. I would recommend that you be open to changes to your code. There are many VERY experienced LabVIEW developers on these forum and there is always an opportunity to learn and improve your code. Just because something works doesn't mean that the code can't be improved dramatically. You may find that being open to suggestion will result in you becoming a better programmer and that your applications are more stable, robust and easier to maintain. For example, more often that not you are much better office using a state machine to replace a flat sequence structure. Learn how to use dataflow properly and the need for sequence structures generally disappears. These are just a few things that can be done.
I guess my point is that it is a good idea to try and remain open above suggestions to improve or change your code.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot -
How to read\write text file into oracle database.
Hello,
I am having text file called getInfo in c:\temp folder. I would like to populate data from text file to data base. How to proceed. Could anybody help me out.
Thanks,
ShailuHere is a web page with easy to follow instructions regarding external files: http://www.adp-gmbh.ch/ora/misc/ext_table.html.
Now I understand what all the excitement is over external tables.
"External tables can read flat files (that follow some rules) as though they were ordinary (although read-only) Oracle tables. Therefore, it is convenient to use external tables to load flat files into the DB." -from the above link. -
How would I writ a file to find a playlist named PL-Mix 01??
Ever since "itunes" quit making available the printing of CD jewel case inserts with their fabulous update of "itunes 11" I have been looking for other ways to print my song titles and artist for my CD's. I know alot of people are using ipads and ipods and iphones and ect. ect. to listen to their music, but I'm and old timer rock n' roller who still listens to CD's. Anyhow I found an inexpensive software simply called MP3 Printer. With this software you can get your song information in (3) different ways. From your CD (which is the only one that works for me) from a directory (which you can browse) or from a playlist, which you can also browse. I would like to use the playlist option, but I can't find where itunes keeps my playlist information. So I was hoping someone in the community or someone from itunes support (if they read these) might be able to help. Also if anyone is interested in getting this software, since it looks like itunes isn't going to be interested in fixing all the problems with itunes 11, I'll be glad to give you the link. C131313 or Carl, Thanks!!!
iTunes 11.0.3.46 released today should fix the CD inlay printing problem. Works fine for me now.
You can save a playlist as a file readable by other software by right-clicking on the playlist and clicking Export Playlist. Interestingly there are 4 options, Text files, XML files, M3U files and M3U files again! (I suspect the last should be M3U8 but I'll have to run tests. Confirmed.)
You probably want the first M3U option.
tt2
Message was edited by: turingtest2
Maybe you are looking for
-
When I try to print a drawing imported from my ipad iphoto crops it. Is there any way to stop this?
-
Delete message from phone only and not server
Hello, I had an issue with my mail settings today and had to delete an email account (Hotmail) and set it up again. Upon doing this, there is no longer the option to delete downloaded message from the phone only and keep it on the server. Is that cor
-
I can no longer open links from my email account into safari, how can I fix this?
I can no longer open links from my email account into safari, on my iphone 4.
-
Html & dynamic values in a mail
Hi, I need to send a mail in wich are written the login information of a user. The Body of the mail should be something like: Hello, you have requested your account informations. They are : login : yourLogin (in bold) password: yourPassword (in bold)
-
Finder questions (changing file icons, moving files, home/e)
Hello all! I got my 17" Intel iMac just two days ago. Gorgeous machine, feeling very comfortable. I switched from Linux and there are a few things I can't figure out on my own, I'd appreciate if someone anmswers these simple questions. 1. How can I c