Text file problem
I wanna search a text file, and get the database name from it. The database name usually follows "BATCH". How can I do that. Thanks.
Actually, the text file is weblogic server's properties file. We stored the database information as one property in that file. Thus you can see, the file is pretty chunky, I don't know if I should read the file line by line, or if there is any easy way to search the file for the occurance of "DBNAME".
Following is just a small part of the property file:
# SYSTEM PROPERTIES
# System properties in this section are set to system defaults
# Performance pack. The shared library must be accessible from your
# PATH (NT) or from your shared library path (UNIX; the name of the
# variable varies: LD_LIBRARY_PATH, SHLIB_PATH, etc.)
weblogic.system.nativeIO.enable=true
# Outputs logging information to the console as well as to the log file
weblogic.system.enableConsole=true
# Sets the directory or URL for the WebLogic Admin help pages
# The help pages are shipped in the "docs/adminhelp" directory, in the
# default document root in public_html
weblogic.system.helpPageURL=C:/weblogic/myserver/public_html/docs51/adminhelp/
# Properties for tuning the server's performance
# Number of WebLogic Server execute threads.
weblogic.system.executeThreadCount=15
# Other optional system properties
# Limits size of weblogic.log (in K) and versions old log
weblogic.system.maxLogFileSize=1024
# Adjust minimum length of password
weblogic.system.minPasswordLen=8
# Database Administration
weblogic.database=DBNAMEMYDB01
MYDB01 is exactly what I want to get from the file.
Similar Messages
-
Quarterly TDS Return generation-Text file problem
Hi
I am working in 4.7 and doing with the TDS Quartrly return. In the text file generation, nothing is coming except some '^' s and 0s. I applied note 873149. Still the problem is not over.
Any help would be highly appreciated.
RegardsHi
I have maintained the section codes and recipient types as well. At the time of quarterly return generation, the excel file is OK. Whereas the text file is having only 0s and ^s. I applied a note for this already. Still it is not resolved. -
Adding text to a text file problem
I have used an Apple script to create a text file and I am having problems with it
First the script creates a file containing text, as a example "ABCDE" then I enter test to the file, say "12345" and the file now has "ABCDE12345". At this point I run my Apple Script to add more data to the file, in this case "FGHIJ".
The problem I am having is the file does not contain "ABCDE12345FGHIJ" as I expect, but instead has "ABCDEFGHIJ" because the EOF was not updated when I added "12345".
I typed the additional text into the text window and saved it to the disk and even closed the window, quit TextEdit and reloaded the file but the results were "ABCDEFGHIJ" and not "ABCDE12345FGHIJ"At this point I think you should get Applejack...
http://www.versiontracker.com/dyn/moreinfo/macosx/19596
http://www.macupdate.com/info.php/id/15667
After installing, Reboot holding down CMD+s, (+s), then when the DOS like prompt shows, type in...
applejack AUTO
Then let it do all 5 of it's things.
The 6 things it does are...
Correct any Disk problems.
Repair Permissions.
Clear out Cache Files.
Repair/check several plist files.
Dump the VM files for a fresh start.
Delete old Log files. -
I have a write to 'text file' in a sub vi. It is a popup where user can change his program.
For some reason, only the first time it is called, it actually writes to the text file.
As long as the sub vi is in memory, and I call it again and press ok to write to text file, nothing happens.
I've tried 'close file', but that doesnt help. Deleting the files from the disk before again calling the sub vi doesnt help either, it wont write
to file again. Is this a bug or am I missing something?! Im on labview 2010Post your VI (along with sub-VI's if any).
I am not allergic to Kudos, in fact I love Kudos.
Make your LabVIEW experience more CONVENIENT. -
import java.io.*;
class FileWrite
public static void main(String args[])
try{
FileWriter fstream = new FileWriter("out.txt");
BufferedWriter out = new BufferedWriter(fstream);
String mmm = "Hi";
out.write("Hello");
out.write("\n"+mmm);
out.close();
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
}This code now rewrites all lines in the file. I would like it only to add new lines, but not to delete old ones. How to do that?By looking up the FileWriter API and calling its constructor so that it will append text, not overwrite:
Look here:
http://java.sun.com/javase/6/docs/api/java/io/FileWriter.html#FileWriter(java.io.File,%20boolean)
call it like so:
boolean append = true;
FileWriter fstream = new FileWriter("out.txt", append); -
Read words from text file by delimiter as columns and rows
Hi All,
I need your help as i have a problem with reading string by delimiter. i have used various tech in java, but i can not get the result as expected.
Please help me to get the string from text file and write into excel . i have used a text file.
problem
get the below as string by delimiter
OI.ID||'|'||OI.IDSIEBEL||'|'||OI.IDTGU||'|'||OI.WORKTYPE||'|'||OI.UTR_FK
read the below as string by delimiter
"50381|TEST_7.15.2.2|09913043548|Attivazione|07-SEP-10
now i need to write the above into excel file as columns and rows.
there are 5 columns and each corresponding values
the outut excel should be
OI.ID OI.IDSIEBEL OI.IDSIEBEL OI.WORKTYPE OI.UTR_FK
50381 TEST_7.15.2.2 09913043548 Attivazione 07-SEP-10
i tried in diffrerent techinq but not able to get the resule. pls help me
Thanks,
Jasmin
Edited by: user13836688 on Jan 22, 2011 8:13 PMFirst of all, when posting code, put it between two tags.
Second of all, the pipe is a special character in regex, so you need to escape it as
.split("\ \|");
Erh. So 2 backslashes before the pipe character. Stupid forum won't post it.
Edited by: Kayaman on Jan 24, 2011 9:35 AM
Edited by: Kayaman on Jan 24, 2011 9:35 AM
Edited by: Kayaman on Jan 24, 2011 9:36 AM -
How to download PF-STATUS of a Report to a Text File
Hi Friends,
Please guide me on this,
I want to download PF-STATUS of a Report into a text file,
Problem is how to get/capture the PF-STATUS.
Regards,
SowjanyaHi,
Please follow the following link
Upload / download PF Status
Regards,
Shailaja -
How to download Documentaion of a Text file to a Report
Hi Friends,
Please guide me on this,
I want to download Documentation of a Report into a text file,
Problem is how to get/capture the Documentaion.
Regards,
Sowjanya
Edited by: sowjanya s on Dec 31, 2008 12:35 PMhi,
DOKHL - Documentation: Headers
DOKTL - Documentation - text lines
DOKIL - Index for Documentation Table DOKH
Use the FM:
SRTU1_GET_REPORT_DOCUMENTATION
Pass the language.
And in the tables IT_REPORTS pass the report name. -
PROBLEM IN CREATING BOM ITEM TEXT FROM TEXT FILE
Hi All,
I am developing interface program for creating BOM based on data it text file. in my text file contain three column(material, qty and longtext). These text i need to upload to BOM TCODE CS01). Using SAVE_TEXT I have generated text object. it don't says any error. But while viewing text in CS03, text is not visible. Give me suggestion or give me any other method for updating item text from textfile.
Thanks in advance.
Regards.
Peranandam.Hi Carl,
Actually problem is SAVE_TEXT updates text but I cant able to view in CSO3 transaction. because while creating BOM I forget for updating language key for long text. After updating language key I can able to view text in CS03.
Now I am facing another problem. If I am executing program directly without going to debug mode, It is not updates text. Logic everything is correct. Give me some suggestions for solving this issue. I am also tried with commit work, Commit_text and wait up n seconds statement.
Regards,
Peranandam -
Problem to send text file to mail from ALV report
Hi Friends,
I have a problem in my ALV report with text file. As per the requirment, when we execute the program then text attachment should go to the particual email.
When i am using file type as XLS i am getting attachment with all 4 recoreds( input for 4 records) in mail. But all 4 records are coming in SAME ROW. It should come 4 records in 4 rows. when I use file type as TXT and separated by pipe symble in code, it is showing only one recored for same above input.
When i use file type as XLS and click the attachment in email, it will triggire one popul with three options like SAVE, OPEN, CANCEL.
But when i click on text file attachment, it is directly showing ony one recored.
Please correct me on this.
my code is
PERFORM send_file_as_email_attachment
tables i_message
i_attach
using v_email
'User last log on details'
'XLS'
'User log on list'
changing v_error
v_reciever.
FORM send_file_as_email_attachment tables pi_message
pi_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: l_error TYPE sy-subrc,
l_reciever TYPE sy-subrc,
l_mtitle LIKE sodocchgi1-obj_descr,
l_email LIKE somlreci1-receiver,
l_format TYPE so_obj_tp ,
l_attdescription TYPE so_obj_nam ,
l_attfilename TYPE so_obj_des ,
l_sender_address LIKE soextreci1-receiver,
l_sender_address_type LIKE soextreci1-adr_typ,
l_receiver LIKE sy-subrc.
l_email = p_email.
l_mtitle = p_mtitle.
l_format = p_format.
l_attdescription = p_attdescription.
l_attfilename = p_filename.
l_sender_address = p_sender_address.
l_sender_address_type = p_sender_addres_type.
Fill the document data.
v_doc_data-doc_size = 1.
Populate the subject/generic message attributes
v_doc_data-obj_langu = sy-langu.
v_doc_data-obj_name = 'SAPRPT'.
v_doc_data-obj_descr = l_mtitle .
v_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR v_doc_data.
READ TABLE i_attach INDEX v_cnt.
v_doc_data-doc_size =
( v_cnt - 1 ) * 255 + STRLEN( i_attach ).
v_doc_data-obj_langu = sy-langu.
v_doc_data-obj_name = 'SAPRPT'.
v_doc_data-obj_descr = l_mtitle.
v_doc_data-sensitivty = 'F'.
CLEAR i_attachment.
REFRESH i_attachment.
i_attachment[] = pi_attach[].
Describe the body of the message
CLEAR i_packing_list.
REFRESH i_packing_list.
i_packing_list-transf_bin = space.
i_packing_list-head_start = 1.
i_packing_list-head_num = 0.
i_packing_list-body_start = 1.
DESCRIBE TABLE i_message LINES i_packing_list-body_num.
i_packing_list-doc_type = 'RAW'.
APPEND i_packing_list.
Create attachment notification
i_packing_list-transf_bin = 'X'.
i_packing_list-head_start = 1.
i_packing_list-head_num = 1.
i_packing_list-body_start = 1.
DESCRIBE TABLE i_attachment LINES i_packing_list-body_num.
i_packing_list-doc_type = l_format.
i_packing_list-obj_descr = l_attdescription.
i_packing_list-obj_name = l_attfilename.
i_packing_list-doc_size = i_packing_list-body_num * 255.
APPEND i_packing_list.
Add the recipients email address
CLEAR i_receivers.
REFRESH i_receivers.
i_receivers-receiver = l_email.
i_receivers-rec_type = 'U'.
i_receivers-com_type = 'INT'.
i_receivers-notif_del = 'X'.
i_receivers-notif_ndel = 'X'.
APPEND i_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = v_doc_data
put_in_outbox = 'X'
sender_address = l_sender_address
sender_address_type = l_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = v_sent_all
TABLES
packing_list = i_packing_list
contents_bin = i_attachment[]
contents_txt = i_message
receivers = i_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
l_error = sy-subrc.Hi,
declare the following constant in u r program and concatenate at the end of each and every record in your internal table.
CONSTANTS : LV_CRLF TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
for eg.
if u internal table has values like
row1
row2
row3
concatenate the 1st record lv_crlf into first record.
conactenate second record lv_crlf into second record.
concatenate third record lv_crlf into third record.
now attach the internal table to the FM which u use for sending email. Each and every row will come in new line. The LV_CRLF will hold nothing but a line feed character (#).
Hope it will solve u r problem
Regards,
Rose. -
Indesign CS3-JS - Problem in reading text from a text file
Can anyone help me...
I have an problem with reading text from an txt file. By "readln" methot I can read only the first line of the text, is there any method to read the consecutive lines from the text file.
Currently I am using Indesign CS3 with Java Script (for PC).
My Java Script is as follows........
var myNewLinksFile = myFindFile("/Links/NewLinks.txt")
var myNewLinks = File(myNewLinksFile);
var a = myNewLinks.open("r", undefined, undefined);
myLine = myNewLinks.readln();
alert(myLine);
function myFindFile(myFilePath){
var myScriptFile = myGetScriptPath();
var myScriptFile = File(myScriptFile);
var myScriptFolder = myScriptFile.path;
myFilePath = myScriptFolder + myFilePath;
if(File(myFilePath).exists == false){
//Display a dialog.
myFilePath = File.openDialog("Choose the file containing your find/change list");
return myFilePath;
function myGetScriptPath(){
try{
myFile = app.activeScript;
catch(myError){
myFile = myError.fileName;
return myFile;
Thanks,
Bharath Raja GHi Bharath Raja G,
If you want to use readln, you'll have to iterate. I don't see a for loop in your example, so you're not iterating. To see how it works, take a closer look at FindChangeByList.jsx--you'll see that that script iterates to read the text file line by line (until it reaches the end of the file).
Thanks,
Ole -
My group box is causing problems when searching for a text line in a text file.
I am developing a booking system, so for this I need to ensure that no two clients can book the same appointment slot. So, on testing my code which prevents double booking, the system doesn't seem to find the text line being searched for in the text file
when it (purposefully) should.
I have tried isolating the problem using breakpoints, and I've found that when the 'SearchLine' (referring to my code below) does not include the 'TimeComboBox.text' piece and instead this value is written into the code, the system is able to find the SearchLine
without any problems. But, when assigning the group box's value to a variable and using this in the SearchLine instead, or without even using a loop and just doing a simple line by line search, the program can't find this line of text in the file.
I'm lost for ideas. I have tried everything I can think of. Could anyone make any suggestions as for what is the problem with my group box? (I'll explain the code beneath it).
'Setting the value of the SearchLine (which is a String)
SearchLine = String.Concat(DateTimePicker1.Value.Date & " " & TimeComboBox.text)
Dim FoundApp As Boolean
Dim objReader As New System.IO.StreamReader(basicfilepath & "Text Files\Client Booked Appointment DatesTimes.txt")
FoundApp = False
'Reading the file's contents and checking for the SearchLine
Do While (objReader.Peek() <> -1) or (FoundApp = True)
If (TextLine = SearchLine) Then
'Line contains SearchLine. Appointment already exists.
FoundApp = True
Else
'Line doesn't contain SearchLine. Carry on searching.
Msgbox("Line not found.")
End if
Loop
Explanation
When the line is searched for, the 'FoundApp' value must be set to 'True' when it is found. If it is not found, it remains false.
To isolate the problem, I've displayed the SearchLine in a message box in the past to make sure that the correct line of text is being searched for.
In basic terms, my program is searching for the exact line of text which exists in the text file, but for some reason it is not coming up as 'Found'. The error occurs when the group box's value is used. The text file which is being read is
definitely correct. Please help, any suggestions would be appreciated.
Thank youHi
It would appear that your snippet doesn't actually read the file at all.
Here is my test which works fine.
Option Strict On
Option Infer Off
Option Explicit On
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim SearchLine As String = "18:09:38 : XTaskSettings.Load PARAMS: begin"
Dim FoundApp As Boolean = False
Dim TextLine As String = Nothing
Dim objReader As New IO.StreamReader(Application.StartupPath & "\Data\Report Q1.txt")
FoundApp = False
Do While (objReader.Peek() <> -1) Or (FoundApp = True)
' this was missing
TextLine = objReader.ReadLine
If (TextLine = SearchLine) Then
'Line contains SearchLine. Appointment already exists.
FoundApp = True
MsgBox("Line found.")
Else
'Line doesn't contain SearchLine. Carry on searching.
MsgBox("Line not found.")
End If
Loop
End Sub
End Class
Regards Les, Livingston, Scotland -
Problem in reading this particular text file, what is the problem with it..
Hai to all..,
I had developed an application to read the text file that is stored in my computer from mobile, all are working fine but some files create problems in reading the file content, like the file i had attached with this..
Can any one please tell why this particular file creates problem in reading the contents...
I had attached a text file with this...
and the code I am using is
int getcharcount;
FileInputStream fstream = new FileInputStream(filename);
InputStreamReader in = new InputStreamReader(fstream);
while ((getcharcount = in.read()) != 0)
getchar = getchar + (char) getcharcount;
System.out.println("Full File Content :"+getchar);
I try'd with BufferedReader also, but have the same problem,
Can any one please give me a solution for this..Hai to all..,
Sorry for the previous posting,
I had developed an application to read the text file that is stored in my computer from mobile, all are working fine but some files create problems in reading the file content, like the file i had attached with this..
Can any one please tell why this particular file creates problem in reading the contents...
and the code I am using is
int getcharcount;
FileInputStream fstream = new FileInputStream(filename);
InputStreamReader in = new InputStreamReader(fstream);
while ((getcharcount = in.read()) != 0)
getchar = getchar + (char) getcharcount;
System.out.println("Full File Content :"+getchar);
I try'd with BufferedReader also, but have the same problem,
Can any one please give me a solution for this..The error I am getting is
Full File Content :ÿþC
But the file contains plain text only..
Edited by: Kamal Raj on Oct 17, 2010 10:22 PM -
Problem in creating text file from report file
Hello Everybody...
I have problem in creating text file.
I had set System Parameter as below
DESTYPE : File
MODE : Character
DESNAME : gayu.txt
And ruler setting
Units : Character Cells
Character Cell Size : Horiziontal = 7
Vertiacle =12
GridSpacing : 1
no of snap points per grid spacing : 1
but when i run report it will give error
"REP_1219 M_2 or R_2 has no size -- length or width zero"
so is there any solution of that
or another way to convert report into text file?....Hi Folks,
Please don't go after that Error as its a very deceptive one. Please don't go for altering your design Or changing the size of items in your layout.
Similar errors I have come across in reports. I think its due to file transfer type. You might have transferred the file in Binary and your File Mode I am seeing it as CHAR.
This normally happens while making the Report Format as "Text". Either you change that format which I think is possible in your case as your basic requirement is making a report output of CHAR type.
Please check for this error in Metalink and proceed accordingly. I could fix similar errors when I changed Format type to PDF(from text).
Regards
Shibu -
Problem reading Japanese text file
Hi - I'm having a problem trying to read in Japanese (EUC) formatted text from a text file. When viewed as ansi, each Japanese character is displayed as two characters (e.g. ��), and there is no problem with editing them in this format in Notepad. However, BufferedReader doesn't seem to want to read some of the characters properly, for example '�'. It reads in as '?', and totally screws up what I am trying to do, which is to read in a text file regardless of its encoding, character by character. Is there any way to do this, or do I need to set up separate conditions for each possible encoding format? Is there another class I can use to read in the characters in this way? If not, how do I read in the characters properly? Thanks very much.
-nsRead a text file regardless of its encoding? Nope.
If it's encoded then you have to decode it, andit's
up to you to specify the encoding.Pardon my ignorance, but isn't that what Unicode is
supposed to be for? Should it be possible to write in
a format (UTF-8?) that encompassed all the characters
you may ever need it to?Yes, that is exactly what Unicode is supposed to be for. And yes, UTF-8 should encompass any character you ever need. But in the real world, as for example in the original poster's case, people encode their files using other standards such as EUC-JP.
Maybe you are looking for
-
Compare two schemas in oracle 11g
Hi All, Can any one please help me how to compare two schemas in oracle 11g. Thanks Edited by: 793914 on Oct 22, 2010 9:33 AM
-
[Solved] Running XBMC without the GUI
Hi, I'm using XBMC as a way to stream all my video and music to my xbox 360, which works really well. The problem is when i want to use my desktop while xbmc is on, because the gui doesnt let me get back to my desktop. I would like to be able to use
-
Restrict security deposit release during final bill
Hello, As per our business requirement security deposit need not to be adjusted with final bill. We have done the configuration as per following screen shot.But security deposit still get adjusted during final bill generation , please specify this co
-
Anchor Tag In Tabbed Panel Content
I used this code to jump to and open the tab. I would like to add an anchor tag name to it so that it jumps to a specific section I have named in the content panel. <a href="#" onclick="TabbedPanels1.showPanel(2); return false;"> This solution does n
-
How do i view silverlight/moonlight content using firefox 6 for linux?
In firefox 7.0.1 for linux the moonlight add-on is not compatible. Is there another way to view silverlight/moonlight/netflix content?