Sponsored Content
Full Discussion: Formatting text file in unix
Top Forums Shell Programming and Scripting Formatting text file in unix Post 302368728 by AAA on Thursday 5th of November 2009 12:38:42 PM
Old 11-05-2009
Formatting text file in unix

Hi,

I am using the following format command for formatting my text file in unix.

awk -F":" '{ printf "%-50s%-1s%-50s\n", $1,":", $2}' filename > targetfile

The target file is then sent as an attachment via email.

When I view the target file in notepad multiple lines get spanned as a single line. When viewed in any other editor (like textpad, crimson) the file is viewed correctly. The file is viewed correctly in unix.

I am attaching the file for reference.

Is there anything wrong in my command? Can any one please suggest me some alternative command so that the file is viewed correctly accross all the windows editor.

Regards,
Abhishek
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

text file formatting by perl

have a simple text file as input.i have to print that file in paragraph format.whenevr it finds "\n" in the input text it should start printing in next paragraph in output file.also a fixed amount of space should be given before start writing in every paragraph. the input and output file format... (5 Replies)
Discussion started by: avik1983
5 Replies

2. Shell Programming and Scripting

Formatting a text file based on newline and delimiter characters

Hi Everybody, I need some help on formatting the files coming into unix box on the fly. I get a file some thing like this in a single line. ISA^M00^M ^M00^M ^M14^M006929681900 ^M01^M095449419 ... (5 Replies)
Discussion started by: ntekupal
5 Replies

3. UNIX for Dummies Questions & Answers

Text file formatting

Hi all! I'm new in unix, and faced with some difficulties. So I have text file f.e. "textfile" which contains rows like: aaa bbb ccc ddd How could I format it, so the file looks like: aaabbb cccddd Thanks in andvance (5 Replies)
Discussion started by: consta.v
5 Replies

4. UNIX for Dummies Questions & Answers

formatting of the text file

Hi Guys, I have a file with contents in the below format DO_VJ_IDOC;03.23.2009;22:31:09; ZJDO_VJ_IDOC;03.23.2009;22:46:14; ZJDO_RESEND_FAILURES;03.24.2009;01:46:18; Now i need to replace the semicolons with tabs for which i am usig the sed command which gives the O/p as below ... (1 Reply)
Discussion started by: rohit.shetty84
1 Replies

5. Shell Programming and Scripting

Formatting the text file using shell script

How to add the filename to end of each line with | as seperator, except first and last line of the file(s) in directories(with diff tree structure) using shell script?. And also how to replace a list of strings with another set of strings, which is present in a file?. Kindly help out on... (1 Reply)
Discussion started by: av_vinay
1 Replies

6. Shell Programming and Scripting

Comparing and Formatting the text file

hi, I need a script which can format the below text file which contains comments file1.txt -------- //START //Name: some value //Date: //Changes:............. //..................... //END //START //Date: //Name: some value //Changes:............. //..................... (3 Replies)
Discussion started by: flamingo_l
3 Replies

7. Shell Programming and Scripting

Need help with formatting file in UNIX

hi, please help me with the below 1)i have a file like below with data 389096 389097 389098 ..and i need some thing like below '389096','ZZ1111' '389097','ZZ1111' '389098','ZZ1111' 2)i have a file like below with data 8300003225 8300003223 8300006494 (7 Replies)
Discussion started by: kr123
7 Replies

8. Shell Programming and Scripting

[Solved] Formatting the text file

Hi All, I ahve requirement where I want to put the text file in into proper format. I am wondering how can i achieve that:- Host/Alias Name IP Address Resolved sinuiy01.infra.go2uti.com 10.240.8.158 N sinuid20.devtst.go2uti.com 10.240.8.230 N sinuid21.devtst.go2uti.com... (6 Replies)
Discussion started by: sharsour
6 Replies

9. Shell Programming and Scripting

Formatting a text file

Hi All :), I have a formatting question and I am unsure on how I should proceed with my bash shell script. I am unsure weather to use perl or simply edit it in bash. I prefer bash but I am only aware of the awk utility to extract parts of a file, not edit output. Scenario: I have a file... (5 Replies)
Discussion started by: bstrizzy
5 Replies

10. Shell Programming and Scripting

Formatting text file

Hi All, how to format text Thanks (19 Replies)
Discussion started by: ROCK_PLSQL
19 Replies
wml::fmt::text(3)						     EN Tools							 wml::fmt::text(3)

NAME
wml::fmt::text - Plain ASCII with Special Formatting Semantic SYNOPSIS
#use wml::fmt::text <: print &wml_fmt_text({ FILE => $file, OPTIONS => '--xhtml', ...}); :> <text notypo> FOO === 1. bar 2. quux a. baz b. foo ... </text> DESCRIPTION
The usage is simple: Surround the text with the "<text>" container tag and then just write plain ASCII text inside it. The corresponding HTML code is created via txt2html(3), a filter which gives the ASCII text nice formatting semantic which control the HTML result. If OPTIONS field is specified, a newer txt2html(1) filter is called instead of txt2html, which is dead upstream. This allows for instance generation of XGTML markup. The core conversion function is wml_fmt_text() which also can be used by other include files. ATTRIBUTES
These attributes can be used both in the "<text>" tag (in lowercase letters) and in "wml_fmt_text" arguments, as shown in examples above. "NOTYPO" By default, font commands are added to headings to highlight them. This attribute prevents alteration of txt2html output. "OPTIONS=str" This attribute performs two actions: select txt2html filter instead of txt2html, and str arguments are passed literally on the command line of txt2html. AUTHOR
Ralf S. Engelschall rse@engelschall.com www.engelschall.com REQUIRES
Internal: P1, P2, P3, txt2html (WML) External: -- SEE ALSO
txt2html(1), txt2html(3) EN Tools 2014-04-16 wml::fmt::text(3)
All times are GMT -4. The time now is 08:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy