Sponsored Content
Full Discussion: Formatting ls output
Top Forums Shell Programming and Scripting Formatting ls output Post 302374711 by bonrad on Thursday 26th of November 2009 03:42:54 AM
Old 11-26-2009
it works, but it cannot handle filenames with whitespaces.

/usr/bin/time -o /tmp/time.txt -f %E find /home/ -regex ".*\.\(avi\|mp3\|mpeg\|mpg\|iso\|rar\)" -exec ls -sh {} \; |awk '{print $2" | "$1}' > /tmp/result.txt

It works until awk gets involved, when printing $2 the whitespaces gets lost.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Formatting the output

Hi all, Have the following code(1) producing the results(2 & 3). Would like to know if there is a way to format the two reports created in a similar fashion. IE - The first is formatted nicely as a result of the echo "$xmpbdate $xavgs" >> $xmpbrpt However when I attempt to do the same on... (7 Replies)
Discussion started by: Cameron
7 Replies

2. Shell Programming and Scripting

formatting output

Hi need some advice.. #grep -i hostname test.csv (gives the below output) HOSTNAME,name,host_test,,,,,,,, Now I need to format the above output as below. HOSTNAME: name=host_test Any easy way of doing this using awk or sed or printf? (4 Replies)
Discussion started by: balaji_prk
4 Replies

3. Shell Programming and Scripting

Formatting Output

Hi I tried running the below awk 'BEGIN { printf ("%s %-51s %s %-7s %s",$var1,$var2,$var3,$var4,$var5)}' from the command prompt and it is not working. Getting the error awk: Field $() is not correct. The source line number is 1. Actually my requirement is to form a string based on... (6 Replies)
Discussion started by: dhanamurthy
6 Replies

4. Shell Programming and Scripting

more help with formatting ls output...

Ok, for a fun project, my goal is to replicate the style of "catalog" on an old apple ] *A 002 SOMEAPPLESOFTFILE B 004 SOMEFILE T 006 SOMETEXT I 002 SOMEINTEGERFILE The first character is either " " or "*" depending on if the file is locked or not. Next is the filetype, so in... (1 Reply)
Discussion started by: patrick99e99
1 Replies

5. Shell Programming and Scripting

formatting output

Sorry for being a n00b, but I'm having a lot more trouble than I should with formatting the output to the program I finally completed. I'm basically looking for the linux equivalent to setw( ) from c++ so that I can print things in columns like this (but without the underlines lol): MISSPELLED: ... (4 Replies)
Discussion started by: aikaterinimak
4 Replies

6. Shell Programming and Scripting

Formatting of output

Hi Experts, I have to create a report for certain audit and my output looks as follows I m trying to format my output to look like Any inputs would be highly appreciated Thanks Syed (5 Replies)
Discussion started by: maverick_here
5 Replies

7. Shell Programming and Scripting

Output Formatting

Hi Guys I need help removing some lines from output i am receiving from a shell script. Here is the output: http://i52.tinypic.com/10z0fut.png I am trying to remove the output that i have circled. . ${EDW}/extracts/bin/extracts_setup2.sh . ${EDW}/extracts/extracts.conf ... (7 Replies)
Discussion started by: mooey1232003
7 Replies

8. Shell Programming and Scripting

Formatting the output

Hi, I have a file which contents entries in this form. Only in /data4/temp abc.000001 Only in /data4/temp abc.000003 Only in /data4/temp abc.000012 Only in /data4/temp abc.000120 Only in /data4/temp abc.000133 Only in /data4/temp abc.001444 i want to read line by line and format... (2 Replies)
Discussion started by: arijitsaha
2 Replies

9. AIX

Help Formatting Output

I am using FORTRAN 90 on AIX 5.3 and need to output my data to a tab-delimited file. It must have actual tabs, and I cannot figure out a way to make it work. The resulting file will be imported into another application (quickbooks) as an .iif file....for some reason, it needs the tabs; spaces do... (2 Replies)
Discussion started by: KathyB148
2 Replies

10. Shell Programming and Scripting

Formatting the Output

Hi, I am trying to use printf command and format certain output in a specific format as under: While the left side (upto |) of the above format is part of a fixed header function, the right side is where i am expecting data to be printed. However, as seen, Row1 value is reflecting on last... (5 Replies)
Discussion started by: EmbedUX
5 Replies
htmlstrip(3)							     EN Tools							      htmlstrip(3)

NAME
htmlstrip - Strip HTML markup code SYNOPSIS
htmlstrip [-o outputfile] [-O level] [-b blocksize] [-v] [inputfile] DESCRIPTION
HTMLstrip reads inputfile or from "stdin" and strips the contained HTML markup. Use this program to shrink and compactify your HTML files in a safe way. Recognized Content Types There are three disjunct types of content which are recognized by HTMLstrip while parsing: HTML Tag (tag) This is just a single HTML tag, i.e. a string beginning with a opening angle bracket directly followed by an identifier, optionally followed by attributes and ending with a closing angle bracket. Preformatted (pre) This is any contents enclosed in one of the following container tags: 1. <nostrip> 2. <pre> 3. <xmp> The non-HTML-3.2-conforming "<nostrip>" tag is special here: It acts like "<pre>" as a protection container for HTMLstrip but is also stripped from the output. Use this as a pseudo-block which just preserves its body for the HTMLstrip processing but itself is removed from the output. Plain Text (txt) This is anything not falling into one of the two other categories, i.e any content both outside of preformatted areas and outside of HTML tags. Supported Stripping Levels The amount of stripping can be controlled by a optimization level, specified via option -O (see below). Higher levels also include all of the lower levels. The following stripping is done on each level: Level 0: No real stripping, just removing the sharp/comment-lines ("#...") [txt,tag]. Such lines are a standard feature of WML, so this is always done. Level 1: Minimal stripping: Same as level 0 plus stripping of blank and empty lines [txt]. Level 2: Good stripping: Same as level 1 plus compression of multiple whitespaces (more then one in sequence) to single whitespaces [txt,tag] and stripping of trailing whitespaces at the of of a line [txt,tag,pre]. This level is the default because while providing good optimization the HTML markup is not destroyed and remains human readable. Level 3: Best stripping: Same as level 2 plus stripping of leading whitespaces on a line [txt]. This can also be recommended when you still want to make sure that the HTML markup is not destroyed in any case. But the resulting code is a little bit ugly because of the removed whitespaces. Level 4: Expert stripping: Same as level 3 plus stripping of HTML comment lines (``"<!-- ... -->"'') and crunching of HTML tag endsi [tag]. BE CAREFUL HERE: Comment lines are widely used for hiding some Java or JavaScript code for browsers which are not capable of ignoring those stuff. When using this optimization level make sure all your JavaScript code is hided correctly by adding HTMLstrip's "<nostrip>" tags around the comment delimiters. Level 5: Crazy stripping: Same as level 4 plus wrapping lines around to fit in an 80 column view window. This saves some newlines but both leads to really unreadable markup code and opens the window for a lot of problems when this code is used to layout the page in a browser. Use with care. This is only experimental! Additionally the following global strippings are done: "^ ": A leading newline is always stripped. "<suck>": The "<suck>" tag just absorbs itself and all whitespaces around it. This is like the backslash for line-continuation, but is done in Pass 8, i.e. really at the end. Use this inside HTML tag definitions to absorb whitespaces, for instance around %body when used inside "<table>" structures which at some point are newline-sensitive in Netscape Navigator. OPTIONS
-o outputfile This redirects the output to outputfile. Usually the output will be send to "stdout" if no such option is specified or outputfile is ""-"". -O level This sets the optimization/stripping level, i.e. how much HTMLstrip should compress the contents. -b blocksize For efficiency reasons, input is divided into blocks of 16384 chars. If you have some performance problems, you may try to change this value. Any value between 1024 and 32766 is allowed. With a value of 0, input is not divided into blocks. -v This sets verbose mode where some processing information will be given on the console. AUTHORS
Ralf S. Engelschall rse@engelschall.com www.engelschall.com Denis Barbier barbier@engelschall.com EN Tools 2014-04-16 htmlstrip(3)
All times are GMT -4. The time now is 02:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy