Input data file into an Array List using scanner
How would i input the data into a new array list with fields iD, name, acc_No, balance, oDLimit.
the data looks like this;
10 10 is included in the data and i can only assume is the size of the array/data to be put in
1/J.Lewis/00-1456/250.54/200
3/T.Standish/01-5682
1/W.Loftus/01-9356/309.43/400
So far i have
public static void main(String[] args) {
ArrayList <BankAccount> CurrentAccounts = new ArrayList <BankAccount>();
Scanner filescan = null;
try
filescan = new Scanner(new File("BankAccountInput"));
catch(Exception e)
System.out.println(e);
}Any help would be great, thanks!
split
Similar Messages
-
I am trying to import data characters from a tab delimited file into a table in labview. After I import the strings, I want to be able to select individual strings from the table and put into another table. I want the item that I am selecting to appear in a text box labeled 'selected step'. After I put all of the selected data in the new table, I want to be able to save that table in another tab delimited file (spreadsheet). This is what I have so far. Any help given will be GREATLY appreciated.
Attachments:
Selector.zip 30 KBHi,
Here are modifications to your vi to do what you are describing. It helps, when trying to work through issues like these on this forum to not start a new thread with each iteration of your question. Those of us that are trying to help can follow it better if you just "Reply" to your previous thread with the new, related question. If the question is for a totally new issue then a new thread is best, but when you are working through the details of essentially the same problem it really helps us follow it if you stay in one thread, and that usually means faster answers.
We also like it if, when an answer helps, you give us a rating (the more stars the better) as it is about all we get out of it!
P.M.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion
Attachments:
SelectorV2.zip 30 KB -
How to read sampled data info from a "*.au"file into an array?
I need to manipulate the sound file directly using DSP, the first step is to read sampled data from "*.au" file into an array. How can I do that? Thanks a lot!!
There is a file I/O tutorial in the Java Tutorial (google for Java Tutorial). You can read an .au file as bytes like any binary file.
Or if you are using the Java Sound API, google for java sound api or java audio tutorial etc etc. -
How to read XI Data type in Java code and populate as array list, using UDF
Hi,
How to read XI Data type in Java code and populate as array list, using UDF?
Is there any API using which the XI data types can be read?
Kindly reply.
RichaInput Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
<CUSTOMER>
<item>
<CUSTOMERNO/>
<MDMCUSTOMER/>
<CREATE_DATE/>
<RETURN>
<TYPE/>
<MESSAGE/>
</RETURN>
<PT_CONTPART_RETURN>
<item>
<MDM_CONTACT/>
<CONTACT/>
</item>
</PT_CONTPART_RETURN>
<PARTNERS>
<item>
<CUSTOMERNO/>
<PARTNER_FUNCTION/>
<PARTNER_NUMBER/>
<DEFAULT_PARTNER/>
</item>
</PARTNERS>
</item>
</CUSTOMER>
</ns0:CustomerCreateResp>
Output structure
(Sample output structure.This actually needs to be mapped and generated using UDF)
<?xml version="1.0" encoding="UTF-8"?>
<ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer> -
Reading from file into an array
Hello, new to Java and we need to modify a mortgage calculator to read interest rate from a file into an array and not have them hard coded in the program. I have read many post on how to perform this but am lost on where to put the new code and format. Here is my code and I hope I posted this right.
import javax.swing.*; // Imports the Main Swing Package
import javax.swing.event.*;
import javax.swing.text.*; // Used for Text Box Caret Position
import java.awt.*; // Imports the main AWT Package
import java.awt.event.*; // Event handling class are defined here
import java.text.NumberFormat;
import java.text.*; // Imports the Main Text Package
import java.util.*; // Imports the Main Utility Package
public class mortgageCalculator1 extends JFrame implements ActionListener // Creates class mortgageCalculator
JLabel AmountLabel = new JLabel(" Enter Mortgage Amount:$ "); // Declares Mortgage Amount Label
JTextField mortgageAmount = new JTextField(10); // Declares Mortgage Amount Text Field
JButton IntandTerm1B = new JButton("7 years at 5.35%"); // Declares 1st Mortgage Term and Interest Rate
JButton IntandTerm2B = new JButton("15 years at 5.50%"); // Declares 2nd Mortgage Term and Interest Rate
JButton IntandTerm3B = new JButton("30 years at 5.75%"); // Declares 3rd Mortgage Term and Interest Rate
JLabel PaymentLabel = new JLabel(" Monthly Payment: "); // Declares Monthly Payment Label
JTextField monthlyPayment = new JTextField(10); // Declares Monthly Payment Text Field
JButton exitButton = new JButton("Exit"); // Declares Exit Button
JButton newcalcButton = new JButton("New Calculation"); // Declares New Calculation Button
JTextArea mortgageTable = new JTextArea(35,65); // Declares Mortgage Table Area
JScrollPane scroll = new JScrollPane(mortgageTable); // Declares ScrollPane and puts the Mortgage Table inside
public mortgageCalculator1() // Creates Method
super("MORTGAGE CALCULATOR"); // Title of Frame
JMenuBar mb = new JMenuBar(); // Cretes Menu Bar
JMenu fileMenu = new JMenu("File"); // Creates File Menu
fileMenu.setMnemonic('F'); // Enables alt + f to Access File Menu
JMenuItem exitItem = new JMenuItem("Exit"); // Creates Exit in File Menu
fileMenu.add(exitItem); // Adds Exit to File Menu
exitItem.addActionListener(new ActionListener() // Adds Action Listener to the Exit Item
public void actionPerformed(ActionEvent e) // Tests to Verify if File->Exit is Pressed
System.exit(0); // Exits the Programs when File->Exit is Pressed
mb.add(fileMenu); // Adds the File Menu
setJMenuBar(mb);
setSize(600, 400); // Sets Size of Frame
setLocation(200,200); // Sets the Location of the Window
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Command on how to close frame
JPanel pane = new JPanel(); // Declares the JPanel
pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS)); // Sets Panel Layout to BoxLayout
Container grid = getContentPane(); // Declares a Container called grid
grid.setLayout(new GridLayout(4,3,5,5)); // Sets grid Layout to GridLayout
pane.add(grid); // Adds the grid to the Panel
pane.add(scroll); // Addes the scrollPane to the Panel
grid.setBackground(Color.yellow); // Set grid color to Yellow
setCursor(new Cursor(Cursor.HAND_CURSOR)); // Makes the cursor look like a hand
mortgageAmount.setBackground(Color.black); // Sets mortgageAmount JPanel JTextField Background Color
mortgageAmount.setForeground(Color.white); // Sets mortgageAmount JPanel JTextField Foreground Color
mortgageAmount.setCaretColor(Color.white); // Sets mortgageAmount JPanel JTextField Caret Color
mortgageAmount.setFont(new Font("Lucida Sans Typewriter", Font.PLAIN, 18)); // Sets mortgageAmount JPanel JTextField Font
monthlyPayment.setBackground(Color.black); // Sets monthlyPayment JPanel JTextField Background Color
monthlyPayment.setForeground(Color.white); // Sets monthlyPayment JPanel JTextField Foreground Color
monthlyPayment.setFont(new Font("Lucida Sans Typewriter", Font.PLAIN, 18)); // Sets monthlyPayment JPanel JTextField Font
mortgageTable.setBackground(Color.yellow); // Sets mortgageTable JTextArea Background Color
mortgageTable.setForeground(Color.black); // Sets mortgageTable JTextArea Foreground Color
mortgageTable.setFont(new Font("Arial", Font.PLAIN, 18)); // Sets JTextArea Font
grid.add(AmountLabel); // Adds the Mortgage Amount Label
grid.add(mortgageAmount); // Adds the Mortgage Amount Text Field
grid.add(IntandTerm1B); // Adds 1st Loan and Rate Button
grid.add(PaymentLabel); // Adds the Payment Label
grid.add(monthlyPayment); // Adds the Monthly Payment Text Field
monthlyPayment.setEditable(false); // Disables editing in this Text Field
grid.add(IntandTerm2B); // Adds 2nd Loan and Rate Button
grid.add(exitButton);
grid.add(newcalcButton); // Adds the New Calc Button
grid.add(IntandTerm3B); // Adds the Exit Button
setContentPane(pane); // Enables the Content Pane
setVisible(true); // Sets JPanel to be Visable
exitButton.addActionListener(this); // Adds Action Listener to the Exit Button
newcalcButton.addActionListener(this); // Adds Action Listener to the New Calc Button
IntandTerm1B.addActionListener(this); // Adds Action Listener to the 1st loan Button
IntandTerm2B.addActionListener(this); // Adds Action Listener to the 2nd loan Button
IntandTerm3B.addActionListener(this); // Adds Action Listener to the 3rd loan Button
mortgageAmount.addActionListener(this); // Adds Action Listener to the Mortgage Amount Text Field
monthlyPayment.addActionListener(this); // Adds Action Listener to the Monthly payment Text Field
public void actionPerformed(ActionEvent e) // Tests to Verify Which Button is Pressed
Object command = e.getSource(); // Enables command to get data
if (command == exitButton) //sets exitButton // Activates the Exit Button
System.exit(0); // Exits from exit button // Exits from exit button
int loanTerm = 0; // Declares loanTerm
if (command == IntandTerm1B) // Activates the 1st Loan Button
loanTerm = 0; // Sets 1st value of Array
if (command == IntandTerm2B) // Activates the 2nd Loan Button
loanTerm = 1; // Sets 2nd value of Array
if (command == IntandTerm3B) // Activates the 3rd Loan Button
loanTerm = 2; // Sets 3rd value of Array
double mortgage = 0; // Declares and Initializes mortgage
double rate = 0; // Declares and Initializes rate
double [][] loans = {{7, 5.35}, {15, 5.50}, {30, 5.75},}; // Array Data for Calculation
try
mortgage = Double.parseDouble(mortgageAmount.getText()); // Gets user input from mortgageAmount Text Field
catch (NumberFormatException nfe) // Checks for correct number fformatting of user input
JOptionPane.showMessageDialog (this, "Error! Invalid input!"); // Outputs error if number is wrong format or nothing is entered
return;
double interestRate = loans [loanTerm][1]; // Sets interestRate amount
double intRate = (interestRate / 100) / 12; // Calculates Interst Rate
double loanTermMonths = loans [loanTerm] [0]; // Calculates Loan Term in Months
int months = (int)loanTermMonths * 12; // Converts Loan Term to Months
double interestRateMonthly = (intRate / 12); // monthly interst rate
double payment = mortgage * intRate / (1 - (Math.pow(1/(1 + intRate), months))); // Calculation for Monthly payment
double remainingLoanBalance = mortgage; // Sets Reamaining Balance
double monthlyPaymentInterest = 0; // holds current interest payment
double monthlyPaymentPrincipal = 0; // holds current principal payment
NumberFormat myCurrencyFormatter = NumberFormat.getCurrencyInstance(Locale.US); // Number formatter to format output in table
monthlyPayment.setText(myCurrencyFormatter.format(payment));
mortgageTable.setText("Month\tPrincipal\tInterest\tEnding Balance\n" + // Formats morgageTable Header
"---------\t----------\t------------\t---------------------\n");
for (;months > 0 ; months -- )
monthlyPaymentInterest = (remainingLoanBalance * intRate); // Calculation for Monthly Payment Toward Interest
//Calculate H = R x I
monthlyPaymentPrincipal = (payment - monthlyPaymentInterest); // Calculation for Monthly Payment Toward Principal
//Calculate C = P - H
remainingLoanBalance = (remainingLoanBalance - monthlyPaymentPrincipal); // Calculation for Reamining loan Balance
// Calculate R = R - C
// H = monthlyPaymentInterest
// R = remainingLoanBalance
// P = payment
// C = monthlyPaymentPrincipal
// I = interestRateMonthly
mortgageTable.setCaret (new DefaultCaret()); // Sets Scroll position to the top left corner
mortgageTable.append(String.valueOf(months) + "\t" + // Pulls in data and formats MortgageTable
myCurrencyFormatter.format(monthlyPaymentPrincipal) + "\t" +
myCurrencyFormatter.format(monthlyPaymentInterest) + "\t" +
myCurrencyFormatter.format(remainingLoanBalance) + "\n");
if(command == newcalcButton) // Activates the new calculation Button
mortgageAmount.setText(null); //clears mortgage amount fields
monthlyPayment.setText(null); //clears monthly payment fields
mortgageTable.setText(null); //clears mortgage table
public static void main(String[] args) //This is the signature of the entry point of all the desktop apps
new mortgageCalculator1();
}OK, making a little progress but am still very confused.
What I have is a file (int&term.dat) with three lines;
5.75, 30
5.5, 15
5.35 ,7
I have three JButtom that I what to read a seperate line and place the term in a term TextField and a rate in a Rate TextField
I have added the following code and all it does now is output a black space to the screen; I am working with one Button and Just the rate for now to try and get it to work. I have been looking at the forums, reading the internet and several books to try and figure this out. I think I may be getting closer.
public static void read()
String line;
StringTokenizer tokenizer;
String rate;
String term;
try
FileReader fr = new FileReader ("int&term.dat");
BufferedReader inFile = new BufferedReader (fr);
line = inFile.readLine();
while (line != null)
tokenizer = new StringTokenizer(line);
rate = tokenizer.nextToken();
line = inFile.readLine();
inFile.close();
System.out.println(new String());
catch (FileNotFoundException exception)
System.out.println ("The file was not found.");
catch (IOException exception)
System.out.println (exception);
} -
Converting a text file into an array
import java.io.*;
public class Copy {
public static void main(String[] args) throws IOException {
File inputFile = new File("farrago.txt");
File outputFile = new File("outagain.txt");
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1)
out.write(c);
in.close();
out.close();
i have been working my way through the online tutorials and have found them very helpful, i have looked at array and would like to know how to convert data from a text file inot an array? using the above example how would i go about doing this?You'd use the readLine () method:BufferedReader reader = new BufferedReader (new FileReader (file));
String line;
List list = new LinkedList ();
while ((line = reader.readLine ()) != null) {
list.add (line);
// don't know why you'd want this, but anyway
String[] lines = (String[]) list.toArray (new String[list.size ()]);Kind regards,
Levi -
Can't input MIDI file into project
Hi,
I can't input MIDI files into a garageband project. I used to do this very easily, just drag & dropping the file into a blank GB project. That was on my previous older computer, with a previous version of GB. Now I just got a brand new iMac G5 with the most up to date version of GB, and it is not working, the MIDI files just will not drop. I even tried by doing an 'open with', selected GB as the software, and got a message saying 'Garageband cannot open files in the midi audio format' !!!
What's even crazier is that a couple weeks ago I had the same problem, and ****** around with trying different things, and at some point GB did accept the files ! But now it doesn't, and I have no idea what I did different then, probably nothing much.
Any ideas ? It sure is highly frustrating (trying to stay polite here) when a brand new, expensive machine cannot do the simple things that a 5 year old one could.Have you tried different files? Maybe one that you're sure worked on your old computer? Some midi files can be tricky.
-
How to transpose the data records (rows) to column(lists) using apd
Hi,
how to transpose the data records (rows) to column (lists) using apd in sap bw.
I do not want to use abap routine.only use the transpose rows to list transformation .
Pls provide the step by step procedure .
thanks,
NimaiSave youe file to transpose as a csv and in the header row of your file for the columns you want to transpose you need to put some soer of a tag before the column name (ie your colum header was for a period budget will be something lie 2011001:ZFIBDD)
1. You will need to create a new apd process (rsanwb)
2. Insert a "Read from Data File" data source object and map it file (,csv)
3. insert a transpose object into your apd process (middle row 4th one over in the transformations section)
4. under the definition tab in the transformation object select all the columns that are to be transposed into rows and move them to the transformed area, the grouping fields section should contain the rows that you want to now be columns
5.under the transformation tab enter in the seperator you selected under the Field Name/Infoobject area (ie. ZFIBDD)
6. under the details tab you need to enter in all the fields to be transformed and tner the transposition field (ie ZFIBDD)
7. Then you can insert a set of transformations and a DSO and link the newly transposed fields into that.
hope that helps -
Reading large binary files into an array for parsing
I have a large binary log file, consisting of binary data separted by header flags scattered nonuniformly thorughout the data. The file size is about 50M Byte. When I read the file into an array, I get the Labview Memory full error. The design of this is to read the file in and then parse it fro the flags to determine where to separate the data blocks in the byte stream.
There are a few examples that I have read on this site but none seem to give a straight answer for such a simple matter. Does anyone have an example of how I should approach this?I agree with Gerd. If you are working with binaries, why not use U8 instead of doubles.
If the file is indeed 50MB, then the array should be expecting 52428800 elements, not 50000000. So if you read the file in a loop and populate an element at a time, you could run out of memory fast because any additional element insertion above 50000000 may require additional memory allocation of the size above 50000000 (potentially for each iteration). This is just speculation since I don't see the portion of your code that populates the array.
Question: Why do you need an array? What do you do with the data after you read it? I agree with Altenbach, 50MB is not that big, so working with a file of such a size should not be a problem. -
Getting file into an array of byte..
Hi guys,
i first thank you for all the help you've given in my precedent posts.
Now i've to ask you a question.
I need to convert some lines of a txt file(obtained from an excel table) into an array of byte in the best possible manner.
My file can have a various number of rows and columns.
With this code
BufferedReader br = new BufferedReader(new InputStreamReader(myFile.getInputStream()));
String line = null;
while ((line = br.readLine()) != null) {
line = line.replace (',', '.');
StringTokenizer st = new StringTokenizer(line);
numberOfNumericColumns = (st.countTokens()-1);
col=(numberOfNumericColumns+1);I read the file, i change , with . and line to line i calculate the number of value(that have to be the same,i do the control for showing exception if necessary).
Now i know from my file what are the number of values in a row(columns of my old excel table).
I have to convert this file into an array of byte.
How can i do it?
Suppose we have only 3 lines, the first line is ever only string,the others lines have a string and other double values.....
nome giuseppe carmine paolo
valerio 23.3 34.3 43.3
paolo 21.2 34.5 12.2
each value is separated from another one by one or more whitespaces..
The most important thing is that in a second moment i have to read this array of byte and showing its original content,so i have to put in the array some different value and different line symbol delimiter.
Can you help me giving me some idea or code?(please be clear,i'm inexpert of java...)
Thanks very much,i need your help
Message was edited by:
giubatthanks for your reply...
my file has about 50000 rows..........and i have to develop an application that allows the upload of about 6000/7000 files....
so i have to optimize everythings......i want to use whitespace to separate different value and ;different line
so in my array of bytes i want
nome(converted in byte) whitespace(in byte) giuseppe (in byte) whitespace(in byte)carmine(in byte) whitespace(in byte) paolo (in byte) ;(in byte);
valerio(in byte) whitespace(in byte) 23.3 (in byte) whitespace(in byte) 34.3 (in byte) whitespace(in byte)43.3 (in byte) ;(in byte) etc.....So i should have an array of byte lower than the array of byte obtained converting each line as a string into bytes.......
do you understand what's my problem?
How can i create an array of byte without fixing its initial dimension that is able to grows up for each line read?
Excuse for my poor english..
In the past i've used a vector to temporary store the data while reading the file and at the end i copied the vector in the array of byte but when i do upload in my application i had java heap size error.
So someone has suggested me to improve my storing method and i've decided to eliminate vector....
can you help me......????
please....i need your help.. -
so im new to this and having problems.
we have to read a .txt file into an array so when a user types a word in a text box it will search the file and reutrn found if the word is there and not found it the word is not there. but it is not reading the text file here is the code so far
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class Checker
// Declares Values in the array
static String [] anArray = new String[1000];
// declares variables needed in code later
int i;
String s;
static int count = 0;
static String b;
static JTextArea j = new JTextArea();
public void readFile() throws IOException{
File inFile = new File("words.txt");
FileReader fileReader = new FileReader(inFile);
BufferedReader bufReader = new BufferedReader(fileReader);
while (true){
b = bufReader.readLine();
anArray[count] = b;
count++;
if(b==null) throw new EOFException("Hello, end of file reached");
j.append(b);
j.append("\n");
// public static void main(String args[]){
// File outFile = new File("words.txt");
//FileOutputStream outFileStream = new FileOutputStream(outFile);
// PrintWriter outStream = new PrintWriter(outFileStream);
// outStream.println("help");
// File inFile = new File("words.txt");
// FileReader fileReader = new FileReader(inFile);
// BufferedReader bufReader = new BufferedReader(fileReader);
/* while (true){
b = bufReader.readLine();
anArray[count] = b;
count++;
if(b==null) throw new EOFException("Hello, end of file reached");
j.append(b);
j.append("\n");
public String checkword(String Word ) {
// Tries the code, runs through until an exception is found.
try {
for ( i = 0; i < anArray.length; i++)
if (Word.equals(anArray))
// If exception is found, throws a new exception
if (Word.equals(anArray[i])) throw new Exception(); // end if
} // end if
} // end for
} // end try
catch (Exception ae ) {
// if the word is found return a message found and its position in array.
return "Found, at position "+i;
}// end catch
// if its not in the array return a not found message
return "Not found";
} // end
} // end
and the gui class :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class CountDown extends JFrame implements ActionListener
// Defines the GUI components
private JTextField Word = new JTextField(9);
private JButton Guess = new JButton("Enter String");
private JLabel Message = new JLabel("not found");
// Creates a new instance of the Checker class.
Checker ch = new Checker();
public CountDown() // constructor
setTitle("Count Down");
setSize(300,200);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
Container c = getContentPane();
c.setBackground(Color.white);
c.setLayout(new GridLayout(3,1));
// Add the components
c.add(Word);
c.add(Guess);
c.add(Message);
c.add(ch.j);
// Add action Listener for Button to work
Guess.addActionListener(this);
pack();
setContentPane(c);
public void actionPerformed(ActionEvent e) {
// When the button is pressed do this code
if(e.getSource() == Guess)
// Looks in the checker class to compare the word user enters, to the words in the array.
// Returns a message if the word exists with its position in the list or
// Returns a message if the word does not exisit.
Message.setText( ch.checkword(Word.getText()));
public class CountDownA
public void main(String[] args)
CountDown Game = new CountDown();
any help is appriciated asapYuck! I echo jverd's sentiment. Please only post the specific pieces of code that you are having trouble with, and use the forum 'code' tags.
But to answer your question, I don't see where you're calling the readFile() method from. If you're not calling readFile, that might explain why nothing is being read.
As for the design of the readFile method, another 'yuck'. heh Don't use exceptions to break out of a loop. If you MUST break out of a loop, use break. But a loop like this doesn't need break. Try something like this:while( (b = bufReader.readLine()) != null)
anArray[count++] = b;
j.append(b+"\n");
}Also, in stead of creating an array of some arbitrary fixed length, I recommend using a collection class such as ArrayList.
In stead of this:static String [] anArray = new String[1000];
anArray[count++] = b;it would be better to use something like this:static ArrayList<String> arrayList = new ArrayList<String>();
arrayList.add(b); -
I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?
I can think of two possible stumbling blocks:
What are your 8.6 options for "byte order" and "prepend array or string size"?
Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
LabVIEW Champion . Do more with less code and in less time . -
I have an XML data file that I want to use to populate a pdf fill-out form. There is enough data in the file to populate several forms. Is there a way of moving each set of data from this XML file into a seperate pdf fill-out form?
Hi,
There are many ways to convert XML files to PDFs through java.
One of the easiest way is by using iText.jar which have classes for conversion.
The following are the required steps
1. Create a document object for the XML file ( Using DOM or SAX parser).
2. Parse the xml document and extract the content to write in PDF.
3.Create a itext Document object.
4.Get a PdfWriter instance for the PDF file.
5.Write in the pdf the extracted text using the document object.
Refer <a href="http://itextdocs.lowagie.com/examples/com/lowagie/examples/general/HelloWorld.java">here</a> for a simple pdf writer example.
Refer <a href="http://java.sun.com/developer/codesamples/xml.html">here</a> for examples of XML Parsers.
Regards,
Uma -
Geting an error trying to import a data file into OWB repository
Hi,
We're using OWB 11.1.0.7.0
I'm trying to import a new data file and I'm getting an error.
When I go to The Project/Files/ I right click on the module I want to add the files to,
I get a 'Wizard' titled 'Welcome to the Import Metadata Wizard'.
I click next.
I get the 'Filter Information' screen that asks if I want to select 'All Data Files' or a specific file.
I pick 'All Data Files' and click 'next'.
I get the 'Object Selection' screen that has a left and right panel. The left side is titled 'Available' and the right side is titled Selected.
The 'Available' panel had the directory in Linux (/etl/datafeeds/dev) where our data files are stored with a plus sign next to it.
When I click the plus sign, I get an error message that says:
API2836: Directory
/etl/datafeeds/dev does not exist.Has anyone seen this? What is the work around? Is it a bug? How do I import a data file into OWB if this isn't the way to do it?
Thanks,Hi, is there any obligation to use import wizard?
can you use right click and import view/table?
Ugur MIHCI
www.ifslibrary.com -
Merge data files into spreadsheet exports 1 field
In acrobat 11.0.5 the 'merge data files into spreadsheet' tool only exports the filename and 1 field. The form was created in livecycle designer ES3 and previous versions created in livecycle 2 and 2.5, using previous versions of acrobat have exported all fields when using the 'merge data files into spreadsheet' tool. IU there a fix for this?
Hi Lori
Many thanks the binding was set to 'none'.
Regards
Dave
Maybe you are looking for
-
Is there a way to send a group text message to more than 10 recepients?
Is it possible to send a group text message to more than 10 recipients? I called AT&T tech support and they said the phone's software limits group messages to no more than 10.
-
Hi, I am getting error "\\Invalid Rules File, which was created using a newer version" in the error file while trying to load dimensions into my outline .
-
How do I hide duplicates in tag view in finder
In finder, when I use tags, I see duplicate copies of many files. I have the iCloud version, the local copy in ~/Library/Mobile Documents, the local copy on my other machine in /Volumes/<other-machine-home>/Library/Mobile Documents, and another path
-
I just left my iPod on hold for two minutes when i came back the screen was blank and it wont come back on the hold switch is not on, i have tried plugging it in to my Mac but it wont recognize it and i have tried re setting it Its dead! Any ideas ot
-
Can't use certain characters as bullets
I'm using CS3 and am trying to define a new paragraph style for bulleted lists. The bullet I want to use is a character in Arno Pro (specifically a flower). I go to the Bullets and Numbering section of the Paragraph Style Options dialog, set Bullets