Sitemap

Amicuk Programming Answers

What is the best way to merge a file content into log file

2015-10-11   Views:0

Advertisement

What is the best way to merge a file content into log file. In worst case, I will read the file line by line as string, then use logger.info(lineString)to output to log file. However, is there better way to do this? The eventual log file will be some

What is the best way to merge a file content into log file.
In worst case, I will read the file line by line as string, then use
logger.info(lineString)to output to log file.
However, is there better way to do this?
The eventual log file will be something like:
log message 1
log message 2
content from file line 1
content from file line 2
content from file line 3
log message 3
log message 4Thanks

The replay answer
Advertisement
John618 wrote:
Thank you and let me explain:
1. What do you mean by better?
I would like to see better performance. read line by line and log each line as string can be slow. Did you measure this and determine that it is actually a problem for your application? Or are you guessing?
Regardless of what you do you are still going to need to read the file.
>
2.The only better way I can think of is not having to do it, but I assume you have a very good reason to want to do this.
Yes, I have to do it beacuse the requirement is to have that file content be part of logging.
Any idea?How is it supposed to be part of it? For example which of the following is better?
        File AAA - contents
                   First Line
                   Second Line XXX
        Log 1
                2009-03-27 DEBUG: Random preceding line
                2009-03-27 DEBUG: First Line
                2009-03-27 DEBUG: Second Line XXX
                2009-03-27 DEBUG: Random following line
        Log 2
                2009-03-27 DEBUG: Random preceding line
                2009-03-27 DEBUG: ----- File: AAA -------------
                First Line
                Second Line XXX
                2009-03-27 DEBUG: Random following lineBoth of the above have some advantages and disadvantages.
The first in a mult-threaded app can end up with intermittent log entries in between lines, so having log lines with thread ids becomes important.
The first can be created by reading one line at a time and posting one at a time.
The second can be created by reading the entire file as a single string and then posting using a single log statement.

Go to See the other 5 answers

Hyper-v VM - merged .avhd files - now cant start as missing .vsv file

Category:DefaultRelease time:2015-10-11Views:130

Hi All, Yesterday i shut down one of our VMs to allow the snapshots to merge and then tried to start the VM but got the following error: 'VM' could not initialize. An attempt to initialize VM save state failed. 'VM' could not initialize. (Virtual Mac[More]

How to merge pdf files into one pdf file?

Category:DefaultRelease time:2015-10-11Views:130

In E-Rec we need the capability to mass printing for correspondance. There i want to merge pdf files for candidates into one pdf file. I am doing the following: Data: lv_document1           TYPE rcf_s_cs_document_content. LOOP AT activity_object_tab[More]

Is there a simple way to merge mp3 files into one mp3 file:

Category:DefaultRelease time:2015-10-11Views:130

Is there a way to simply merge multiple mp3s into one? I have audacity; however, that program becomes cumbersome when merging multiple files. My thanks to anyone for help on this one.I have audacity; however, that program becomes cumbersome when merg[More]

I want to merge mp3 files into one file so i can play a mix in i tunes without pauze

Category:DefaultRelease time:2015-10-11Views:130

i want to merge mp3 files into one file so i can play a mix in i tunes without pauzeAudacity is what you need. Obviously you need to create a new MP3 file of the combined songs and not delete the originals. If your DJ-ing and/or just have too many so[More]

RoboHelp HTML Version 8 - Merging AIR files

Category:DefaultRelease time:2015-10-11Views:130

We use Webhelp Pro to merge 19 separate projects into a single merged help file. Can I do that with AIR output, and if so, how? Can anyone point me to a tutorial?Hi there! I agree with what both Pater and Rick have said, but there may be another way[More]

What is the best way to merge a file content into log file

Category:DefaultRelease time:2015-10-11Views:130

What is the best way to merge a file content into log file. In worst case, I will read the file line by line as string, then use logger.info(lineString)to output to log file. However, is there better way to do this? The eventual log file will be some[More]

Merging PDF Files in Preview 5 in OS X v10.7 Lion

Category:DefaultRelease time:2015-10-11Views:130

I recently updated to the OSX v10.7 Lion operating system.  In the previous version I had, I was able to merge two or more PDF files in Preview just by dragging the thumbnail.  However, in the Lion version, it is not allowing to drag one PDF file int[More]

Adobe Acrobat, Print multiple files to PDF and merge open files to closed files?

Category:DefaultRelease time:2015-10-11Views:130

I have Adobe Acrobat XI Professional. Print to PDF – How can this be done for more than 15 documents at a time?  Right now, if I select 16 or more documents, I cannot 'right click' and choose 'print'.  Is this a setting issue?  If I have many documen[More]

Merge/append the contents of a pdf file to an MS Word document in JAVA

Category:DefaultRelease time:2015-10-11Views:130

Hi experts, I have a requirement to merge/append the contents of a pdf file to an ms word document(Not to be done by including pdf file objects in word). Please suggest some java libraries or ways to do it using java. Any pointers would be appreciate[More]

Problem in Merging PDF files

Category:DefaultRelease time:2015-10-11Views:130

Need to print batches of PDF.<br />The command copy *.PDF > LPT1: (redirected by NET USE) doesn't work.<br />On the printer I get an error message. All files are sent in one file.<br />.<br />I guess this is related to the PDF h[More]

Issue with Merging two files in BPM

Category:DefaultRelease time:2015-10-11Views:130

Hi, I need to merge two files (Balance and transaction) with correlation is defined from ID, Date and Accountnumber.. Sometimes, when there are no transaction records, then balanace file will come up number "0" Balance file: MDk;1728;175;02.09.1[More]

Hot
I am trying to extend the range of my Netgear 7550 using the airport express.  When trying to set up the airport express it said that I was unable to extend the Netgear.  Any ideas how to make it work?You need to configure a roaming network. Wi-Fi ba [More]
I am trying to use a website that requires that my computer have the latest version of Java, which I have updated and installed Java 7 Update 51 (64-bit), however Firefox does not recognize that I even have Java on my computer. My computer is 64-bit [More]
My company upgraded from flash CS5 to Flash Professional CC just recently, and i was hoping for a more stable experience, as Crashes when saving from Flash CS5 happened allmost daily. Seem i was wrong, occasionally when saving Flash CC crashes, and e [More]
Will the next update for iOS 8 fix the issue for guides access for Ipad 2? Issue; function not working at all. And when will this update come? We have now tried everything we can think of. Reset settings, totale factory reset etc. This doen both on t [More]
i tried update and all the relavent instruction and yet my phone wont connect to wi fi or bluetooth wt can i do?please any one help i m going out of my mindRead other 3 answers [More]
We have a unique requirement. Once the PDf is generated thru Web Dynpro, the users want to be able to import one or more PDF documents at the end of the generated PDf document. Then they want to save it as one big PDF document. Is this doable? Has an [More]
Hi Experts, While deploying my application into DEV server i am getting error like [06:45:20 PM] Weblogic Server Exception: weblogic.application.ModuleException: [06:45:20 PM] Caused by: weblogic.common.ResourceException: java.security.PrivilegedActi [More]
I restored my HP DV5 laptop to original factory settings. Once the restoration was complete, the computer restarted, but every time it boots back up and begins to install windows, a window pops up stating that an error was encountered during installa [More]
I'm trying to download the iOS 6.1.3 for my Ipad 2, but an error shows in Itunes due to a connection timed out. Does anyone knows how to fix it so I can finally update my ipad?Try temporarily turning off all your firewall and antivirus software on yo [More]
Hello, I want to configure a Bea Weblogic 8.1 Cluster including an itanium and an i686 server. I have sucessfully configured a weblogic cluter with 2 Sun servers. Now I want to use for my weblogic cluster an itanium server together with an Intel i686 [More]