Save to text file
Hi Experts,
Im trying to read first a text file and I wanted to replace the contents of the said file, How can I save the changes that I did on the text file? do you know what FM I can use? Thanks
BR,
Chris
Hi,
First read the text file into internal table using FM shown below.
FM call to upload file
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_file_name
filetype = lv_filetype
has_field_separator = lv_gui_sep
TABLES
data_tab = gi_zhralcon_file.
Then after the reqd changes use the FM as shown.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = binfile
filename = 'D:\MYFILE.txt' //give the address where u want output.
FILETYPE = 'BIN'
tables
data_tab = pdftab
Hope it helps.
Regards
Rajesh Kumar
Similar Messages
-
How to Save a text file in the server?
hello
i just want to save an text file in the server.
My idea is to load an xml text file maybe make some changes
and then save it back to the server, so i can avoid all the
database/php work because i know nothing about it.
thank youhello
i just want to save an text file in the server.
My idea is to load an xml text file maybe make some changes
and then save it back to the server, so i can avoid all the
database/php work because i know nothing about it.
thank you -
HOW TO SAVE A TEXT FILE ON AL11
HOW CAN WE SAVE A TEXT FILE ON THE APPLICATION SERVER AL11 WHICH IS ON THE DESKTOP OR ANY DRIVES.
CAN SOME ONE GIVE ME THE STEP BY STEP PRCEDURE
REWARDS IF USEFULHi,
Use Tcode CG3Z to upload files to application server and use tocde CG3Y to download file to your desktop.
Reward points if helpful.
Regards,
CS. -
Browse users presentation server directory and save a text file in it
Hi All,
We have a requirement in which I need to provide two buttons Browse and Export in CRM web UI with following functionality:-
1) On click of browse button user should have an option to browse and select a folder(not file) from presentation server(useru2019s computer).
2)Once user selects a folder and click export button, I need to save a text file in this folder.
Any help on any of the above two requirements will be highly appreciated.
Regards,
VimalHey Vimal,
did you find a solution for your problem?
Actually I'am facing exactly the same issue.
Thank you very much.
Regards
Marc -
I need to make an app that lets the user save a text file to their docs
i am a 14 year old developer, and i have a problem with interface builder. i would like to add a button, or option in the menu that will allow the user to save a file. it is just a basic text file. can anyone please help? and im a code noob, so make it simple! thanks!
Seen these?
Guides:
http://developer.apple.com/library/mac/search/?q=open+save
Application File Management:
http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/AppFileMgm t/
The Save and Open Panels:
http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/AppFileMgm t/Concepts/SaveOpenPanels.html
Managing Accessory Views:
http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/AppFileMgm t/Articles/ManagingAccessoryViews.html -
How can I save a text file to disk from Illustrator ?
Hi,
I was looking through the Javascript reference and couldn't find anything related to writing strings to a text file on disk.
Is this possible ? If so where should I look ?
Otherwise, can I run a bit of code in Terminal/CommandPrompt from Illustrator (.e.g. echo 'Hello!' >> file.txt) ?Here's something that I think Muppet Mark or Carlos Canto posted earlier
#target illustrator
var textFile = File('~/Desktop/AI.txt');
var doc = app.activeDocument;
var docText = '';
for (var i = 0; i < doc.textFrames.length; i++)
docText += doc.textFrames[i].contents + '\r';
textFile.open('e');
textFile.write(docText);
textFile.close(); -
Search PDF contents for ISBN number and save to text file
Hi,
Hoping someone can help me create a script that can find the ISBN inside of a PDF and write that filename and number to a text file.
I've found a way to do this using java using and document processing in Acrobat but I need to do it by pointing at a folder of files.
Format desired would be:
original filename.pdf, isbn#
Any help is appreciated,
Johnyou could give the command line tool ps2ascii a try. It also works with pdf and you could pipe it's output (pure text) to a nice perl/ruby/grep/sed/awk 1-liner to extract the isbn numbers (still have to read a book about Regular Expression ;-) )
I did a quick & dirty version, but I think you will have to install ps2ascii first. I don't remember but I think it was installed with ghostscript (using macports)
--30.04.2011 hubionmac.com
--quick & dirty script to extract first ISBN-Number of a PDF file... just uses grep, maybe some nice reqexp would do a better job!
set myselection to choose file of type {"pdf"} with multiple selections allowed
set myoutput to ""
repeat with pdf_file in myselection
tell application "Finder" to set pdfname to name of (pdf_file as alias)
set pdf_file_posix to quoted form of POSIX path of (pdf_file as alias)
do shell script ""
try
--first add the path, otherwhise s2ascii will fail since it cannot find ghostscript (gs) which is also installed in /usr/local/bin (think by macports)
set ISBN_String to do shell script "PATH=\"$PATH:/usr/local/bin\"; /usr/local/bin/ps2ascii " & pdf_file_posix & " | grep -m 1 ISBN"
set foundLine to true
on error
display dialog "maybe \"" & pdfname & "\" does not contain a ISBN at all"
set foundLine to false
end try
if foundLine is true then
repeat with s in every word of ISBN_String
try
get s as integer
set s to s as text
set foundisbn to true
exit repeat
on error
set s to ""
end try
end repeat
end if
set myoutput to myoutput & pdfname & tab & s & return
end repeat
tell application "TextEdit"
activate
set a to make new document
set text of a to myoutput as text
end tell -
How can I create a text file that is not in a UTF format and is just plain text?
This is the code I have but it creates the text in UTF8
Private Sub PlacefileUpdate_Tick(sender As Object, e As EventArgs) Handles PlacefileUpdate.Tick
Dim FILE_NAME As String = "X:\Data\polygon_placefile.txt"
My.Computer.FileSystem.WriteAllText(FILE_NAME, "", False)
If Verticies.Items.Count = 8 Then
Dim i As Integer
Dim aryText(14) As String
aryText(0) = "Title: Polygon"
aryText(1) = "Threshold: 999"
aryText(2) = "RefreshSeconds: 1"
aryText(3) = ""
aryText(4) = "Color: 255 255 255"
aryText(5) = "Line: 3, 0, Polygon"
aryText(6) = Verticies.Items(0)
aryText(7) = Verticies.Items(1)
aryText(8) = Verticies.Items(2)
aryText(9) = Verticies.Items(3)
aryText(10) = Verticies.Items(4)
aryText(11) = Verticies.Items(5)
aryText(12) = Verticies.Items(6)
aryText(13) = Verticies.Items(7)
aryText(14) = "End:"
Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
For i = 0 To 14
objWriter.WriteLine(aryText(i))
Next
objWriter.Close()
End If
End Sub
Regards, Carter HumphreysASCIIEncoding Class - From link in previous post.
Maybe you are viewing the text with an application not set for ASCII encoding.
La vida loca
Notepad. All I know is that it that the current code I have creating a UTF8 format and what I have that works is ASCII encoding.
Regards, Carter Humphreys -
Hi!
I have a Flash Projector and i want to save in a text (.txt)
file the data from the input box.
How can i do this?
Andre Michaud
Quebec, Canadause adobe air. otherwise, you'll need to pay for a wrapper
program like zinc. -
Browser can't find a text file opened via the save as dialogue box
Hi there,
I have a servlet which outputs a file using the servlet output stream, with the following lines set:
response.setContentType("application/msword");
response.setHeader("Content-Disposition", "attachement; filename="+ fileName);
servletOutStream.write(myBytes);
servletOutStream.flush();
It works fine for .doc files and it seems the mechanism is that it is saved to the Temporary Internet Folder and delivered from there when the user clicks on the 'open' or 'save' option in the browser popup dialogue box. However... when I try this with text files, (setting the content type to "text/plain") I get the open/save dialogue box up correctly but if I try to open the file it says it cannot find the file, and gives the path under the Temporary Interenet Folder. If I look in there the text file isn't present - though the .doc files are.
So... it looks as if the problem is that for some reason it doesn't save the text files correctly to the Temporary Internet Folder.
I can't deliver the text files inline as a solution as the filename is lost and it thinks it's an html file (which the client doesn't want).
Any ideas?
AlisonAt least also set the content length. Your browser may be configured be the default application to open textfiles. If the contentlength is not set, then most applications would refuse to open the file without choosing for 'Save' first and manually open it.
-
Problem with saving data in text file in Application server
Hello Experts,
I am trying to save a text file in application server.When I text file have less that 60000 (i.e 59999) records, it saves the file successfully, but if records in text file (saved in application server) is more than 60000 (i.e 60002), it creates a new file at the 60000th record with the continued records.
Can anyone please advise, why it is creating a new file if records are more that 60000. I tested it with 59000 records in my internal table and it is working fine. I have not given any restriction in my program to create a new file if records are more than 60000.
The logic I implemented is the following:
*Open file
open dataset g_accnt_file for output in text mode encoding utf-8.
if sy-subrc = 0.
clear g_header_record.
*Building header record for Accounting Validation file
concatenate gc_hdr_desc
gc_filetype
gc_sequence
gc_idntf_refresh
gc_cmpny_idntf
gc_accnt_id
sy-datum
sy-uzeit
gc_linde_group
sy-sysid
gc_not_used into g_header_record separated by
gc_deliminator.
transfer g_header_record to g_accnt_file.
*Move Cost center data to file to create a detail record for Accounting
*Validation file
loop at gt_csks into gs_csks.
*Remove leading Zeros
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = gs_csks-kostl
importing
output = gs_csks-kostl.
* Overlay gs_csks-kostl with space.
* SHIFT gs_csks-kostl RIGHT DELETING TRAILING gc_space.
*Prepare Cost Centre String
perform prepare_costcentre_string.
*Prepare detail record with Company Code & Cost Centre
perform prepare_detail_record.
clear:g_detail_record,gs_csks,g_coa.
endloop.
*Move Order data to file to create a detail record for Accounting
*Validation file
loop at gt_aufk into gs_aufk.
*Remove leading Zeros
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
exporting
input = gs_aufk-aufnr
importing
output = gs_aufk-aufnr.
* SHIFT gs_aufk-aufnr RIGHT DELETING TRAILING gc_space.
*Prepare Order String
perform prepare_order_string.
*Prepare detail record with Company Code & Order
perform prepare_detail_record.
clear:g_detail_record,gs_aufk,g_coa.
endloop.
*Move WBS data to file to create a detail record for Accounting
*Validation file
loop at gt_prps into gs_prps.
call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
exporting
input = gs_prps-pspnr
importing
output = g_wbs_element.
* SHIFT g_wbs_element RIGHT DELETING TRAILING gc_space.
*Prepare WBS Element String
perform prepare_wbs_string.
*Prepare detail record with Company Code & WBS Element
perform prepare_detail_record.
clear:g_detail_record,gs_prps,g_coa.
endloop.
*Building trailer record for Accounting Validation file which will
*contain the total number of detail records in file
concatenate gc_trail_desc
g_total_count
into g_trailer_record
separated by gc_deliminator.
transfer g_trailer_record to g_accnt_file.
*Close file
close dataset g_accnt_file.
if sy-subrc = 0.
message s036(/lig/fi).
endif.
endif.
endform. " SELECT_DATA
Edited by: Matt on Sep 30, 2010 11:02 AM - added tagsHi Pankaj,
Can u check the concatenate statement with one more data. Check the no of lines for a single file.
concatenate gc_hdr_desc
gc_filetype
gc_sequence
gc_idntf_refresh
gc_cmpny_idntf
gc_accnt_id
sy-datum
sy-uzeit
gc_linde_group
sy-sysid
sy-subrc
gc_not_used into g_header_record separated by
gc_deliminator.
Regards,
Amitava -
Hi,
Using the Script for VB worked to open multiple .xls files. Now I want to add to the code and Save As Text files with original name.
thxSorry I am new to forums. I used the script on the forum page: http://social.technet.microsoft.com/Forums/en-US/57d8995e-49c0-43af-a637-6102a49a4df1/batch-script-to-open-multiple-excel-and-doc-files?forum=ITCG
strComputer="."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='C:\test'} Where ResultClass = CIM_DataFile")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = TRUE
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
For Each objFile In colFileList
If objFile.Extension = "xls" Or objFile.Extension = "xlsx" Then
objExcel.Workbooks.Open objFile.Name
ElseIf objFile.Extension = "doc" or objFile.Extension = "docx" Then
objWord.Documents.Open objFile.Name
End If
Next
This opened all my .xls files in C:\Test folder, and using same code with Close I can close them all too. I want to save each as a text file, before closing. That way I can sort all the .txt files together. As it is now, I open the .xls
, SaveAs text, close, repeat. -
Error writing path into a text file
Latest edit to my text edit script is trying to remember the last opened file using a .txt "preference" file in a script bundle.
Before I click run I edit the Pref file and put Default. I then click Open last. It then does what it should (alot like my other post) but gets an error at the last write in the script, writing the file path to the pref file. This is taken from the event viewer:
write alias "Macintosh HD:Users:Richard:Documents:Other Text Files:Untitled.txt" to file "Macintosh HD:Users:Richard:Library:Scripts:Richard's Text Editor 3.scptd:Contents:Resources:Prefs:Save Location Pref.txt" as text
Result:
error "Can’t make alias \"Macintosh HD:Users:Richard:Documents:Other Text Files:Untitled.txt\" into type string." number -1700 from alias "Macintosh HD:Users:Richard:Documents:Other Text Files:Untitled.txt" to string
Script here:
display dialog "Open last saved or choose file" buttons {"Open last", "Open other"} default button 2
if button returned of result is "Open last" then
set val1 to (read POSIX file "/Users/Richard/Library/Scripts/Richard's Text Editor 3.scptd/Contents/Resources/Prefs/Save Location Pref.txt")
if val1 is "Default" then
EditFile("no")
else
EditFile(val1)
end if
else
EditFile("no")
end if
on EditFile(val2)
if val2 is "no" then
set val3 to (choose file with prompt "Please select a .txt file:
To save a text file as .txt in TextEdit, click 'Make Plain Text' in the Format menu and save the file.")
--Get file path.
else
set val3 to val2
end if
if (get eof val3) is 0 then --Read doesn't like eof (end of file) to be 0 bytes.
set val4 to ""
else
set val4 to read val3 --Read file before it gets erased.
end if
open for access val3 with write permission --Open file.
set eof val3 to 0 --Erase file.
repeat
display dialog "Edit your text." default answer val4 buttons {"Revert", "Save"}
set {val5, val6} to {text returned of result, button returned of result}
if val6 is "Save" then
write val5 to val3
exit repeat
else
write val4 to val3
end if
end repeat
--Write to file giving old data as default (to give the same affect as as read and edit).
close access val3
open for access POSIX file "/Users/Richard/Library/Scripts/Richard's Text Editor 3.scptd/Contents/Resources/Prefs/Save Location Pref.txt" with write permission
set eof POSIX file "/Users/Richard/Library/Scripts/Richard's Text Editor 3.scptd/Contents/Resources/Prefs/Save Location Pref.txt" to 0
write val3 to POSIX file "/Users/Richard/Library/Scripts/Richard's Text Editor 3.scptd/Contents/Resources/Prefs/Save Location Pref.txt" as text
close access POSIX file "/Users/Richard/Library/Scripts/Richard's Text Editor 3.scptd/Contents/Resources/Prefs/Save Location Pref.txt"
end EditFile
Thanks, I can guess this is a simple fix like the others.Hmmm.
First I checked it was all OK without POSIX and it works:
display dialog "Open last saved or choose file" buttons {"Open last", "Open other"} default button 2
if button returned of result is "Open last" then
set val1 to alias (read file "Macintosh HD:Users:Richard:Library:Scripts:Richard's Text Editor 3.scptd:Contents:Resources:Save Location Pref.txt")
--Read pref file to find out path of last edited file.
if val1 is "Default" then
EditFile("no")
else
EditFile(val1)
end if
else
EditFile("no")
end if
on EditFile(val2)
if val2 is "no" then
set val3 to (choose file with prompt "Please select a .txt file:
To save a text file as .txt in TextEdit, click 'Make Plain Text' in the Format menu and save the file.")
--Get file path.
else
set val3 to val2
end if
if (get eof val3) is 0 then --Read doesn't like eof (end of file) to be 0 bytes.
set val4 to ""
else
set val4 to read val3 --Read file before it gets erased.
end if
open for access val3 with write permission --Open file.
repeat
set eof val3 to 0 --Erase file.
display dialog "Edit your text." default answer val4 buttons {"Revert", "Save"}
set {val5, val6} to {text returned of result, button returned of result}
if val6 is "Save" then
write val5 to val3
exit repeat
else
write val4 to val3
end if
end repeat
--Write to file giving old data as default (to give the same affect as as read and edit).
close access val3
open for access file "Macintosh HD:Users:Richard:Library:Scripts:Richard's Text Editor 3.scptd:Contents:Resources:Save Location Pref.txt" with write permission
set eof file "Macintosh HD:Users:Richard:Library:Scripts:Richard's Text Editor 3.scptd:Contents:Resources:Save Location Pref.txt" to 0
write (val3 as string) to file "Macintosh HD:Users:Richard:Library:Scripts:Richard's Text Editor 3.scptd:Contents:Resources:Save Location Pref.txt" as text
close access file "Macintosh HD:Users:Richard:Library:Scripts:Richard's Text Editor 3.scptd:Contents:Resources:Save Location Pref.txt"
--Save path of edited file to pref file.
end EditFile
But change that 3rd line to:
set val1 to alias (read file (path to resource "Save Location Pref.txt"))
gets:
Can’t make file (alias "Macintosh HD:Users:Richard:Library:Scripts:Richard's Text Editor 3.scptd:Contents:Resources:Save Location Pref.txt") into type file.
P.S. Sorry bout question in answered post again. -
i want to generate a file in run mode and that file contain username and password and i dont want to save as text file
is there away i can save it in encoded file that cant be opend easily?
another quistion : how can I make curren value in a string control defualt in run mode?
many thanxmana111;
Users will always be able to open the file, some way or the other. What you don't want is the ability to understand it - you want to preserve the confidentiality. First, you need to determine what needs to be protected. Usually the username is known and therefore no protection is provided. The password always need protection. Also, you need to determine your recovery procedures. Users WILL forget their passwords. That has an impact on how to protect the password. If you want the ability to tell the user their password, then you may want to encrypt the password so the administrator can decrypt it. If instead you want to give them a new password, then you can hash the password. With that technique you won't be able to recover the lost password. If you encrypt the password, you need to have a key management scheme because you need to manage the key that encrypt the passwords - that is equivalent to a master key.
I've seen systems where the password does more than just authenticate the user. It is also used as a key to encrypt additional information. If that's your case, you need to encrypt the password. There are other considerations for your systems. The ideal way to understand the best solution is via a security assessment.
Check Crypto-G: www.visecurity.com. It is a very good library with algorithms for encryption, hashing (message digest) and other cryptographic functions.
Regards;
Enrique
www.vartortech.com -
Create new text file in UTF-8 format by default
I'm working a lot with UTF-8 text files and mainly in this format. It's becoming annoying when I have to manually save every text file as UTF-8. After several trial-and-errors, I've made up a procedure that I've put in a blog. I think I could share
it here for those who need it. Hope it helps.
http://instrumenti-meliora.blogspot.com/2014/04/create-new-text-file-in-utf-8-format-by.htmlYou've made a procedure?
Are you sure you didn't :
Didn't what?
https://www.google.com/#q=change+notepad+default+encoding
Well, I'm not sure what you want me to see, but your search keywords do
NOT make sense. You do note change *Notepad* default encoding. What you can change is a
TEXT file's default encoding.
Well, of course, if you have access to Notepad source code and you're able to change it and re-compile again, then you could really say you change Notepad's "default encoding", which I suppose would mean "default encoding every time we save".
Why wouldn't you just provide a link (or some attribution) to the top result
http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/default-utf-8-encoding-for-new-notepad-documents/525f0ae7-121e-4eac-a6c2-cfe6b498712c
or a link to watch this done on youtube?
http://www.youtube.com/watch?v=GnL6smxQE9k
The title of that forum post and Youtube video is a non-sense. New
"Notepad" document? Come on! That's apparently how a newbie think what it is and it's very likely he has not a clue what it is and what he is doing. And what if I don't use Notepad to create such file? If I
use UltraEdit, then mine should be "UltraEdit" document and that should be different from Notepad document, correct? LOL
The fact that you're able to find this video would also mean you're thinking like him in that the file is really called Notepad document LOL
For your information, that's called a text file (or document if you prefer this prettier term). It's also called plain text file.
Now, let's see the content of both links:
First of all, why did they tell people to create a new text file somewhere and then
COPY it to template folder? That's really so dumb
LOL Isn't it more intelligent to create such file directly INSIDE the folder?
Secondly, their procedures are not foolproof. What if the Windows directory is not c:\windows? They should tell people to open %Systemroot%\ShellNew instead. I suppose they don't even know how this folder is called because
nowhere is the term "template folder" ever mentioned.
Thirdly, what if that folder doesn't work for unknown reason (which might happen in XP)? Did they give any hint to a "failover" folder? No, they didn't. But I do in my procedure.
Fourthly, they are saying as if the file name has to be "TXTUTF-8.txt", but actually we can call it whatever we like. But smart people would have figured this out at the end.
5 (I'd stop saying fifthly and so on LOL) I'm not sure it's necessary (or recommended) to change "fSavePageSettings" & "fSaveWindowPositions" DWORD values for Notepad as "advised" in that answer.
As a side-note, I don't know what
http://www.pc1news.com/saving-changes-to-notepad-configuration-1216.html is supposed to give but when I open this, I got some uTorrent warning. Really seems like some malware webpage which tries to deceive people!
I actually searched how a (generic) new file is created and started from there.
So, maybe next time when you want to criticize or discredit somebody else, try to be more expert first? ;)
Maybe you are looking for
-
Auto Email notification based on data from Table
I need to send a auto email notification based on the information updated on the table. Like when response table is updated as 90 for ( column users).A Email should automatically trigger to the different users listed in a table named (email).. I have
-
Really silly question I think.
I have an applet that I am trying to add buttons to. The Applet uses Border Layout. I want to add two buttons side by side at the bottom of the frame, but whenever I say container.add(jButton1, BorderLayout.SOUTH); container.add(jbutton2, BorderLayou
-
Restrictions Error after opening Acrobat
Hello all, I'm having a problem with Acrobat version 11.0.06. This issue only happens with our Windows 7 computers in our server 2003 AD domain. I keep getting this error: Restrictions "This operation has been cancelled due to restrictions in effect
-
I did an opps and deployed the latest IOS image to all of our switches, I have looked and looked for a way to stop the deployment. Right now I have stopped the the service but I need to find out a way to stop the deployment when I turn Prime back on?
-
Facetime disappeard from my iphone 5 after i changed my simcard and network... Any way i can get it back?