I have to write formatted output in the file in java 1.4 environment (for compatibility). My object is PrintStream out; and I need to write something like: out.format("%-5s", data); How Can I make that possible?
Getting formatted output in file using PrintStream (java 1.4)
218 Views Asked by mrig At
2
There are 2 best solutions below
2
Brian Agnew
On
You might try an old implementation of printf that's now redundant for the newer JVMs.
Related Questions in FILE-IO
- python how to write list of lists to file
- Why does command prompt show numbers before I begin?
- How can i access a js file in my project?
- I want to add a string in between of 2 strings in file, but in output whole text is getting appended at the end of file
- Where do I call an async method from?
- FileWriter() will only append, not overwrite
- How to scan several drives for specific directories?
- C language - Read specific data from text file
- NoSuchFileException when creating a file using nio
- How to force project to work only within it's directory?
- dojo 1.10 How to read text file a user has picked with a file picker
- Python Fabric - erasing my remote file when it should be copying to it
- Access Denied when trying to open with File.OpenRead
- Node.js v0.10: Replace certain bytes in file without reading whole file
- How to read a Bunch of files in a directory in lua
Related Questions in FORMATTING
- C++: Re-use line printed to console
- NSAttributeString - How to remove auto formatting for a date or time item?
- Bifurcate a string, removing the middle of the string instead of end
- Use DateTime format in a class but restrict time tokens
- Doesn't change the format of columns to date
- How do I convert a double into an n-character string using exponential notation?
- Java Integer Pyramid
- proper way to get nice string from exception
- How to edit text in columns?
- Simple and clean java float to string conversion
- Having trouble with list post-processing
- Formatting equations?
- Looking to export the content from a website into doc files
- SAPUI5 local scope object as formatter function parameter
- DataTable contains strings with Hashtags when imported from .xlsx instead of .xls
Related Questions in JAVA1.4
- Sort hierarchically related data together
- jOptionPane dont show on top windows. Java 1.4
- Deserializing XML using XStream does not work in OSGi (Java 1.4)
- How can I mock static methods in Java 1.4?
- Axis generated wsdl does not include all type definitions
- JUnit 3 assumption like JUnit4 needed or equivalent technique available to Java 1.4
- How to cause a compile error/warning, when a protected (or abstract) method in the parent class is removed and sub-classes have implemented it
- JDK1.4.2 doesn't return IPV6 address using getHostAddress
- How to convert sync method to async method in Java 1.4
- java 1.4 :how to insert multiple records in a database with one single hit using executeBatch?
- Null Object When Passed Into An Anonymous Inner Class
- Web service frameworks for Java 1.4?
- java:not able to set auto commit mode with value false in java 1.4 api?
- how to call procedure in database asynchronously from java 1.4 code?
- Is there a generic Collections library wrapping non-generic Collections?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I realized using out.format will also work, i will need to supply buffer arguments.