How to export to text file without ruin the format
Hi guys,
I need some help here. My company recently come with the decision to print the mainframe report file that usually come as a text file, to a virtual printer. This virtual printer is printing the report as Adobe PDF format. The problem is, my Line of Business have a macros on Excell file that will grab the information from the text file to be processed in the Excell format. I tried to use Adobe Professional 8 to re-convert the PDF file to be text file, but the result is, most of the blank space is gone, and it is align to left, thus make it unusable to the Excell file.
Unfortunately, I can't provide you the sample of the document, because it contain classified customer info.
But appreciate if you can give me some advice.
Thanks and Regards.
It sounds as if you are dealing with untagged PDF.
Tagged output PDFs, with a well-formed structure, provide (amoung other things) the ability to Save As/Export
content to some other applications with all or most of the layout/format intact.
I suspect that the output PDFs you have are untagged.
As there is, currently, a rather limited number of applications that support adequate tag management
(FrameMaker, InDesign, MS Word (via Adobe's PDFMaker & to a much lesser extent with Office Save As to PDF - XPS)
I suspect the mechanism used to provide your PDFs won't cut it with regards to providing a tagged output PDF having a
well-fomed structure (which would include dictionaries containing format/layout data).
As alluded to by Bernd, there may be third party plug-ins that might help.
The more reliable/functional ones tend to not be inexpensive.
Be well...
Similar Messages
-
How do I export to text file and suppress the cr-lf at end of row?
Hello.
I have created a report that is mean to export to a text file. It will always be a 1 row report and it's always going to be uploaded to a vendor via their website. They don't want the cr-lf at the end of the row.
I can't figure out how to get crystal to not do that. When I export to a text file (not a tab delimited text file), it seems to throw in the cr-lf at the end of the row. I have to manually remove it before uploading it. This task of uploading the file will go to someone else in the near future and I would like to not have to rely on them to do it.
Am I missing it?Could you please elaborate what do you mean by 'cr-lf'. Just came across these SAP notes,however don't know whether they are applicable in your context.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313331333533303333%7D.do
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313333333333373332%7D.do
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303334333033383337%7D.do
Thanks -
How to open a text file without using dialog box
I can open a file using dialog box but I want to open a file without using any dialog box for writing.
With the following commands a new file is created.
File outputFile = new File("outagain.txt");
FileWriter out = new FileWriter(outputFile);
I want to open an existing file and put some more text in it using FileWriter or any other object
rgds,
Arsalanimport java.io.*;
class UReader
BufferedReader in;
BufferedReader input;
String fileName;
public UReader(String fileName)
this.fileName = null;
this.fileName = fileName;
try
in = new BufferedReader(new FileReader(fileName));
input = new BufferedReader(new FileReader("A.b"));
catch(IOException _ex) { }
public final String getContent()
String txt = "";
try
while(in.ready())
txt = txt + in.readLine();
txt = txt + "\n";
in.close();
txt.trim();
catch(IOException _ex) { }
return txt;
public final String getLine(int row)
try
input = new BufferedReader(new FileReader(fileName));
catch(IOException _ex) { }
String txt = null;
if(row <= getRows()) {
try
for(int i = 0; i < row; i++)
txt = input.readLine();
input.close();
catch(IOException _ex) { }
} else {
txt = "Index out of Bounds";
return txt;
public final int getRows()
try
input = new BufferedReader(new FileReader(fileName));
catch(IOException _ex) { }
String txt = null;
int rows = 0;
try
while(input.ready())
txt = input.readLine();
rows++;
input.close();
catch(IOException _ex) { }
return rows;
import java.io.*;
import java.util.*;
class UWriter
PrintWriter out;
String fileName;
String[] txt;
static int NEW_LINE = 1;
static int APPEND = 0;
public UWriter(String s)
fileName = null;
txt = null;
fileName = s;
try
out = new PrintWriter(new BufferedWriter(new FileWriter(s, true)));
catch(IOException ioexception) { }
public final void addContent(String s, int i)
int l = 0;
StringBuffer sb = new StringBuffer(s);
s.replaceAll("\n\n", "\n###\n");
StringTokenizer str = new StringTokenizer(s, "\n");
String token = null;
while (str.hasMoreTokens()) {
++l;
token = str.nextToken();
str = new StringTokenizer(s, "\n");
txt = new String[l];
int k = 0;
String test;
while (str.hasMoreTokens()) {
test = str.nextToken();
if (test.equals("###")) test = "";
txt[k++] = test;
if(i == 0) {
try
for (int j = 0; j < txt.length; ++j) {
out.println(txt[j]);
out.close();
catch(Exception ioexception) { }
} else {
try
out.println();
for (int j = 0; j < txt.length; ++j) {
out.println(txt[j]);
out.close();
catch(Exception ioexception1) { }
public final void writeContent(String s)
int l = 0;
s.replaceAll("\n\n", "###");
StringTokenizer str = new StringTokenizer(s, "\n");
String token = null;
while (str.hasMoreTokens()) {
++l;
token = str.nextToken();
str = new StringTokenizer(s, "\n");
txt = new String[l];
int k = 0;
String test;
while (str.hasMoreTokens()) {
test = str.nextToken();
if (test.equals("###")) test = "";
txt[k++] = test;
try
PrintWriter bufferedwriter = new PrintWriter(new BufferedWriter(new FileWriter(fileName, false)));
for (int j = 0; j < txt.length; ++j) {
bufferedwriter.println(txt[j]);
bufferedwriter.close();
catch(IOException ioexception) { }
}Maybe they are not the best codes, i wrote them a long time ago, so dont ask why i did anything wierd. :D
But anyway it works. -
How to view contents of file without opening the file?
Does anyone know of a utility that will allow you to quickly view the contents - or a part thereof - of a file (particularly Word files) without having to open the file? I have thousands of files restored after a disk failure, but their filenames have been lost and replaced with sequential numbers. The only way of knowing the contents is to open the file, a tedious process for so many. I seem to recall seeing a shareware app that allowed this. Thanks for any help.
MacBook Pro 17 Mac OS X (10.4.8)Open the Script Editor in the /Applications/AppleScript/ folder and paste in the following:
tell application "Finder"
repeat with this_num from 1 to 5
set the_item to item this_num of window 1
set the_name to name of the_item
set the_text to (read (the_item as alias) from 1 to 15)
tell application "TextEdit"
set text of document 1 to (text of document 1) & the_name & return & the_text & return & return
end tell
end repeat
end tell
Before running the script, place the folder containing the files in the frontmost Finder window; you may want to split the files between several different folders and process each folder before heading on to the next one. The numbers in blue can be customized as needed; the first one controls how many files the script will search on each run, and the other two define what part of the file will be searched. The output from a file which is in a format other than plain text may contain document formatting and other content which will look like random characters.
(19999) -
Reading text files without specifying the encoding?
I have looked everywhere for a solution, but I can't find one. The problem is that I'm using codes that everybody is using, but for some reason, my codes aren't working.
I want to be able to open up text files in Java without having to specify the encoding for the files that I'm going read, because I have no idea which encoding they will use.
But even when specifying UTF-8 to be encoding of the file to read, it doesn't work correctly:
FileInputStream fileIS= new FileInputStream("somefile.txt");
Reader reader = new BufferedReader(new InputStreamReader(fileIS, Charset.forName("UTF-8")));
EVERYWHERE I look, ppl are using these codes! But it doesn't work, some characters (such as the Euro sign) are displayed as squares.
However, I want to be able to read not only UTF-8 files but anything that Java supports. Any ideas?
Edited by: Stalfos on Oct 22, 2007 12:22 PMStalfos wrote:
I want to be able to open up text files in Java without having to specify the encoding for the files that I'm going read, because I have no idea which encoding they will use.
This is your problem. If you don't know what encoding the text is stored in, then the chances that the default encoding used to read it will be correct are slim.
But even when specifying UTF-8 to be encoding of the file to read, it doesn't work correctly:There are many different character encodings, and most of them don't overlap. Anything above 127 usually causes problems.
FileInputStream fileIS= new FileInputStream("somefile.txt");
Reader reader = new BufferedReader(new InputStreamReader(fileIS, Charset.forName("UTF-8")));
EVERYWHERE I look, ppl are using these codes! But it doesn't work, some characters (such as the Euro sign) are displayed as squares.The problem isn't with the code, it's that the file you're reading isn't using an encoding that's compatible with UTF-8. Assuming that using UTF-8 should work for all encodings is like assuming that someone who can read Chinese should be able to read a book written in Spanish or Greek. It doesn't work that way.
However, I want to be able to read not only UTF-8 files but anything that Java supports. Any ideas?You need to know what encoding your files are stored in, period. There are a few ways to guess what the encoding is, but they're only reliable for a small set of encodings.
You don't seem to truly understand what character encodings are, or how to use them, so read this:
The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
http://www.joelonsoftware.com/articles/Unicode.html -
Converting PDF files with tables back to Microsoft Word without lossing the format
I am trying to convert a large amount of PDF files that has tables on them (some are filliable Forms). I need to convert the files to Microsoft Word 10. I have tried to convert the files by using the export option but it would lose the format and the tables would go crazy. Is there a software that I could buy or a process that I could use to get the files to export the files without losing the format. Hopeful I have explained this issue clear enough in order to get help.
That suggests that the PDF was not created with PDF Maker that retains the format information. As a result, there is not much you can do with Acrobat if it is not converting properly. You can try to save as HTML or RTF and import those into WORD. Sometimes those conversions will do better, but not real sure.
You can also use a copy and paste from the PDF with the alt key held down to force the column mode of copy. Unfortunately, with Acrobat there is not much more you can do. There are some 3rd party products that focus on the conversion to WORD and I understand do a much better job for the type of untagged document you likely have. Check with PDF Zone or Planet PDF for the 3rd party solutions. Be aware, they are not cheap either. -
How to export the text edit data to excel file without splitting the data in excel file?
how to export the text edit data to excel file without splitting the data in excel file?
I have a requirement in SAP HR where in the appraiser can add comments in the area given and can export that to excel file. Currently the file is getting exported but the comments getting split into deifferent rows.
I want the entire comment to be fit in one row.
Please help.
Thank youHi,
if your text edit value is stored in 'lv_string' variable.
then before exporting the value to excel you have to remove CL_ABAP_CHAR_UTILITIES=>NEWLINE
that is '#' from the variable lv_string.
for that use code some thing like this.
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE in lv_string WITH space.
I think this will do the trick. -
How to generate reports in text file without totals
Hi!!!
Does anybody knows how can I generate a report in text file
(separated by |), but without the lines with totalizations ?
In my application, the user can choose if he wants the output
in HTML,PDF or a text file. So, the solution to this question
must be implemented in code.
Thanks a lot,
Anderson.If you put a formatting trigger on any item or frame and return FALSE, it will disappear.
So the totals need to be within a frame which has a trigger which returns false if text file is chosen. -
How can I add a header to a text file without mapping? [Using only ID]
Hi Experts,
I am doing a scenario in which I want to add a dynamic header to a text file, due to the complications related to the structure, I dont want to create a message type, data type etc so I cant use mapping.
I want to do all the manipuations in Integration Directory itself.
Can you all please help me out in this?
Thanks in advance
ThomasHi Experts,
I am new to XI, so only elaborate answers would help me
This is the specific requirement i want;
There is a 'source text file' which is a collection of 1000+ records, I want to make a 'target file' which is a combination of 2 fields, one field will be the dynamically generated name [for the target file] and the other field will be the whole 'source file' content.
From the last response for my question, I understand the dynamic file generation part can be done using java mapping.
Is there anyway by which I can get in the whole content of the source file into a field in the target file?
Thanks in Advance
Thomas -
How can I convert text to PDF in the new "Pages" without losing info.
How can I convert text to PDF in the new "Pages" without losing a lot if information?
Select Export To from Pages' File menu, then select PDF from the sub-menu.
-
The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!
You must go in the labview option menu, you can select 'use the local
separator' in the front side submenu (LV6i).
If you use the "From Exponential/Fract/Eng" vi, you are able to select this
opton (with a boolean) without changing the labview parameters.
(sorry for my english)
Lange Jerome
FRANCE
"Nina" a ecrit dans le message news:
[email protected]..
> I would like to read a text file in which the decimal numbers are
> using dots instead of commas. Is there a way of converting this in
> labVIEW, or how can I get the program to enterpret the figures in the
> correct way?
>
> The program doest enterpret my figures from the text file in the
> correct way since the numbers contain dots instea
d of commas. Is there
> a way to fix this in labVIEW, or do I have to change the files before
> reading them in the program? Thanks beforehend! -
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. -
Is it possible to read/write to text file without deleting it?
I know how to read from a text file and how to write to a text file. The problem that i have is i need to use a text file to store data for my application to read and also for my application to write. I would like it if i could write two programs really, one reads, the other is used to update the text file. This file is a list of verbs. I thought about using databases but i couldn't get them to work. I downloaded MySQL server 5.0 and installed it. I then downloaded the driver from http://www.mysql.com/products/driver and ran the auto installer. it said everything worked out perfectly but when i try these lines:
Class.forName("com.mysql.jdbc.Driver");
I get a SQLException that says no suitible driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
( I thought this driver came with the JDK but i guess not, i just read about it in a java book)
I get a ClassNotFoundException
that just says sun.jdbc.odbc.JdbcOdbcDriver
So yeah, SQL is pretty much not working. I need a solution to my problem, either by using text files, or a different type of database. I heard you could use excel to create a database but i have no idea how and i hear microsoft access could also do this, however i don't have microsoft access and i don't intend on paying for it. So, here are my questions:
1st, is there a tutorial on using excel databases in java programs
(if not)
2nd is there a way to read/write/update a text file without deleting it?
(if not)
3rd is there a way to get SQL working, i have windows vista this could be the problem
(if not)
4th what could i do to store information on the hd for reading and modifying later?
thanks, lateralusA database might be overkill just for a list of words.
Thoughts:
<ul>
<li>What is the extent of your "file updating"? If you are just appending to the file, opening it in append mode will keep the file from being clobbered.</li>
<li>Otherwise, why not create new files instead of editting them? The file names could include a version number or timestamp, allowing the reader to select the newest one.
</li>
</ul> -
How can I read text files from LAN if I only know the hostname?
I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
<p>1. How can I read text files from LAN if I only know the hostname, or IP address?
<p>2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.
(ex. how can I read the 120th line?)
<p>Please help!
<p>sorry for the bad englishI'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
1. How can I read text files from LAN if I only know the hostname, or IP address?You need to know the URL of the file. You need to know the hostname, port, protocl and relative path.
The hostname is server, not file.
2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.Use the seek() to get to a random byte.
(ex. how can I read the 120th line?)The only way to find the 120th line is to read the first 120 lines. You can use other file formats to find the 120th line without reading the whole file but to need to be able to detremine where the 120th line is -
Serving Text files without html extension as html pages
I have a large site that has a number of legacy html files with no extensions. The site was running under 10.3 just fine. Just reinstalled 10.4 and now these pages are rendered as plain text in the browser.
I've tried adding a blank entry in the extensions under the text/html mime/type setting but doing so creates an error which stops the server. I've got hundreds of these files stored for several years that I don't want to go back through and add a .html on the end of.
How can I get the web server to treat a file without an extension as an html file?I know this isn't an answer to the question you're asking, but are you sure you want that behavior? There might be times where you want an extensionless file to be loaded as a plain text file. At the very least, it will help make your site more compatible.
If all these files are collected in the same area on your system, it might be best to give them the .html extension.
You can do this relatively painlessly with virtually any scripting language. I know I've even seen an AppleScript that will go through a batch and change the extension for you. You might want a modified one that will first check for the start/end HTML tags in the file first to make sure you're only changing HTML files. A quick Google search for scripting a filename change will probably yield lots of results (check Perl and PHP resource sites as well).
Maybe you are looking for
-
I have an 8 year old eMac G3. It will not start up. I need to erase it before putting it in recycling. Apple refuses to open the case and warns me that I will be shocked if I even try. They say no way to erase hard drive. They say use a hammer. Any i
-
External Hard Drive (Samsung) not recognised since I updated to Mavericks
Hi, Since I updated to Mavericks I can't see my external Samsung HD when I plug it in. It's lit up and my ports are working fine. I can however see that it is listed under 'Disk Utility' - butwhat do I need to do so that I can use it again? Any advi
-
How to chage the logical Name of a Process flow?
Hi, While I am creating process flows, some times, I do copy of one process flow its creating copy_of_pf1 ( for the process flow pf1) and I am doing necerrary changes and updating the process flow name. But in the backend, its maitining Physical name
-
Do not use the Restore from Backup when upgrading
For those having issues...... Try to restore your phone as "New" and not from a backup. After you have a clean version iOS 4.0 on your phone customize your phone manually, do not use a backup. i know this can be a pain in the *** but it should fix mo
-
Technologies Used : Jdeveloper 11.1.1.0.1 + ADF BC Problem Description - Home page contain panel spiller , First facet contain link to dynamic Region in the Second facet - dynamic Region has backing bean scope - every dynamic Regions consists of Pane