Sponsored Content
Top Forums UNIX for Dummies Questions & Answers ASCII file printing staggered lines Post 302409200 by lordvoldemort on Wednesday 31st of March 2010 11:27:45 AM
Old 03-31-2010
ASCII file printing staggered lines

I am trying to print a simple ascii file but it comes out as a staggered output. I know there's a simple solution but can't remember it, am a little rusty.

eg. a file that look like

Code:
  aa
  bbb
  cccc

would print out like
Code:
  aa
    bbb
      ccccc

Any pointers would be appreciated.
Thanks,

Last edited by Scott; 03-31-2010 at 01:12 PM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

question about printing number of lines in a file

as the title, I had try use "wc -l test.txt" but it give me "<many spaces> 384 test.txt" but the result I want is just "384" could any person can help me that? Thx:( (5 Replies)
Discussion started by: a8111978
5 Replies

2. Shell Programming and Scripting

printing first n lines in a file without using head

i have to print first n lines of a file. how can i do that without using head command. for some reason i do not want to use Head. is there a way to get that result using awk or sed?. i an using this on korn shell for AIX Thanks.. (7 Replies)
Discussion started by: dareman123
7 Replies

3. UNIX for Dummies Questions & Answers

Counting no. of lines and printing it at the start of the file

Dear users, I need to count the number of lines in a simple text file and print the number on the first line of that same file. I know I can count the lines using wc -l file.txt this gives for example 100 file.txt I need the number 100 to be printed at the very top of file.txt... (2 Replies)
Discussion started by: jenjen_mt
2 Replies

4. Shell Programming and Scripting

printing lines to a file from a particular string

Hi, A very Good Evening to All, I am writing a script for my application. I have a file with 1000 lines. Among that 1000 lines i am searching for a particular string. And from that string i need to pull all the data in to a seperate file. For example the contents of my file is as below. ... (4 Replies)
Discussion started by: intiraju
4 Replies

5. Shell Programming and Scripting

Printing several lines of a file after a specific expression

Hello, I want to print a number of lines of a file after a specific expression of a line. I have this sed command but it prints only 1 line after the expression. How could I adapt it to print for instance 10 lines after or 15 lines after ? sed -n '/regexp/{n;p;}' Thx & Regs, Rany. (5 Replies)
Discussion started by: rany1
5 Replies

6. AIX

Printing extended ASCII

Hi All, I'm trying to send extended ascii characters to my HP2055 as part of PCL printer control codes. What I want to do is select a bar code font, print the bar code and reset the printer to the default font. Selecting the bar code font works good. Printing the bar code goes almost ok too. ... (5 Replies)
Discussion started by: petervg
5 Replies

7. Shell Programming and Scripting

Trouble printing multiple lines to a new file

Hi, I'm trying to auto generate some php files with a default preamble at the top which is a block comment. The problem is that my output has no new lines and it looks like the output from "ls" is being printed after everyline This is my code #!/bin/bash read -d '' pre_amble... (1 Reply)
Discussion started by: racshot65
1 Replies

8. Shell Programming and Scripting

Printing out duplicate lines in a file with Csh

Hi guys, I was wondering if there was an easy solution, using tcsh, to print out lines that appear twice with a given pattern in a file? So if I am looking for lines with "test" in a given file that contains: blah test blah1 blah //don't print this out as it doesn't have... (3 Replies)
Discussion started by: chu816
3 Replies

9. Shell Programming and Scripting

Printing the lines that appear in an other file, and the three lines after them

Hi ! I need some help with a script I am writing. I am trying to compare two files, the first file being in this format : Header1 Text1-1 Text1-2 Text1-3 Header2 Text2-1 etc... For each header, I want to check if it appears in the second file, and if it is the case print the header... (4 Replies)
Discussion started by: jbi
4 Replies

10. Shell Programming and Scripting

Convert Hex to Ascii in a Ascii file

Hi All, I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting? Thanks in Advance (2 Replies)
Discussion started by: HemaV
2 Replies
HTTP::Proxy::HeaderFilter::simple(3pm)			User Contributed Perl Documentation		    HTTP::Proxy::HeaderFilter::simple(3pm)

NAME
HTTP::Proxy::HeaderFilter::simple - A class for creating simple filters SYNOPSIS
use HTTP::Proxy::HeaderFilter::simple; # a simple User-Agent filter my $filter = HTTP::Proxy::HeaderFilter::simple->new( sub { $_[1]->header( User_Agent => 'foobar/1.0' ); } ); $proxy->push_filter( request => $filter ); DESCRIPTION
HTTP::Proxy::HeaderFilter::simple can create BodyFilter without going through the hassle of creating a full-fledged class. Simply pass a code reference to the filter() method of your filter to the constructor, and you'll get the adequate filter. Constructor calling convention The constructor is called with a single code reference. The code reference must conform to the standard filter() signature for header filters: sub filter { my ( $self, $headers, $message) = @_; ... } This code reference is used for the filter() method. METHODS
This filter "factory" defines the standard HTTP::Proxy::HeaderFilter methods, but those are only, erm, "proxies" to the actual CODE references passed to the constructor. These "proxy" methods are: filter() begin() end() Two other methods are actually HTTP::Proxy::HeaderFilter::simple methods, and are called automatically: init() Initalise the filter instance with the code references passed to the constructor. can() Return the actual code reference that will be run, and not the "proxy" methods. If called with any other name than "begin" and "filter", it calls UNIVERSAL::can() instead. SEE ALSO
HTTP::Proxy, HTTP::Proxy::HeaderFilter. AUTHOR
Philippe "BooK" Bruhat, <book@cpan.org>. COPYRIGHT
Copyright 2003-2005, Philippe Bruhat. LICENSE
This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.12.4 2011-07-03 HTTP::Proxy::HeaderFilter::simple(3pm)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy