Sponsored Content
Top Forums Shell Programming and Scripting Aligning columns in a text file using Perl Post 302620365 by smarty86 on Sunday 8th of April 2012 02:56:06 AM
Old 04-08-2012
Thanks buddy working as expected... thanks again.. u guys are very helpful Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to convert text to columns in tab delimited text file

Hello Gurus, I have a text file containing nearly 12,000 tab delimited characters with 4000 rows. If the file size is small, excel can convert the text into coloumns. However, the file that I have is very big. Can some body help me in solving this problem? The input file example, ... (6 Replies)
Discussion started by: Unilearn
6 Replies

2. Shell Programming and Scripting

Aligning text files by max field length

Hello, Is there anyway that I can align a pipe delimited text file by the maxium field length where the field is separated out by pipes for large text files with more than 100,000 rows? So, far I have searched other forums and google about aligning text files in unix and I have noticed that... (7 Replies)
Discussion started by: physalis2099
7 Replies

3. Shell Programming and Scripting

Aligning numbers in the second file based on first file

Hi All, I have two sets of files with names .dat and .txt. The number of files is really large more than 90000. The files have names like 1.dat, 2.dat,3.dat and so on where as txt files have names like 1.txt, 2.txt, 3.txt and so on The DAT and TXT files are equal in number. About 90000 each ... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies

4. UNIX for Dummies Questions & Answers

Removing columns from a text file that do not have any values in second and third columns

I have a text file that has three columns. But at the end of the text file, there are trailing lines that have missing second and third columns: 4 0.04972604 KLHL28 4 0.0497332 CSTB 4 0.04979822 AIF1 4 0.04983331 DECR2 4 0.04990344 KATNB1 4 4 4 4 How can I remove the trailing... (3 Replies)
Discussion started by: evelibertine
3 Replies

5. UNIX for Dummies Questions & Answers

Perl - adding columns to file

I have a file in which I need to add more columns to based on a key in the first file: File1 key1,abc,123, key2,def,456, key3,ghi,789, File2 key2,zyx,111,qqq, key3,yuu,222,www, key1,pui,333,eee, key4,xxx,999,rrr, I would like to create the following output: Output (1 Reply)
Discussion started by: WongSifu
1 Replies

6. UNIX for Dummies Questions & Answers

Help with Aligning the content of a txt file

Hello friends Please help me to display the content of a file in specific aligned manner. for ex. the content of the file may be >$TEST WELCOME HI HELLO UNIX SHELL SCRIPTING >$ I want to display the content like . TEST WELCOME HI HELLO ... (18 Replies)
Discussion started by: rajmohan146
18 Replies

7. Shell Programming and Scripting

Replace text in column1 of a file matching columns of another file

Hi all, I have 2 files: species-names.txt Abaca-bunchy-top-virus ((((Abaca-bunchy-top-virus((Babuvirus((Unassigned((Nanoviridae((Unassigned)))) Abutilon-mosaic-virus ((((Abutilon-mosaic-virus((Begomovirus((Unassigned((Geminiviridae((Unassigned))))... (2 Replies)
Discussion started by: thienxho
2 Replies

8. Shell Programming and Scripting

How to concatenate 2-columns by 2 -columns for a text file?

Hello, I want to concatenate 2-columns by 2-columns separated by colon. How can I do so? For example, I have a text file containing 6 columns separated by tab. I want to concatenate column 1 and 2; column 3 and 4; column 5 and 6, respectively, and put a colon in between. input file: 1 0 0 1... (10 Replies)
Discussion started by: huiyee1
10 Replies

9. Shell Programming and Scripting

Perl syntax for formatting columns and text

Dear all, Pzl let me know what is the syntax for converting the columns format to text as i have lots of values for but when i put these values in xls sheet the values are automatically converted to and one more question i have is how to call values from shell script into perl script eg. ... (3 Replies)
Discussion started by: sagar_1986
3 Replies

10. Shell Programming and Scripting

Aligning a file

I have a large text file in following format cat input.txt abc qwert qwer afweferf wdfwefwe ==> kjhjkwdd mnmn ==> jkjkjwekj poiu ==> lklklke tytyutut ==> olkjmnsmn I need to align those lines with the characters " ==>" . I dont want to disturb the lines which dont have "==>". The... (6 Replies)
Discussion started by: ctrld
6 Replies
TEXT-VIMCOLOR(1p)					User Contributed Perl Documentation					 TEXT-VIMCOLOR(1p)

NAME
text-vimcolor - command-line program to syntax color a file in HTML, XML or PDF SYNOPSIS
$ text-vimcolor --format html --full-page FILENAME > OUTPUT.html $ text-vimcolor --format xml FILENAME > OUTPUT.xml $ text-vimcolor --format pdf FILENAME --output OUTPUT.pdf DESCRIPTION
This program uses the Vim text editor to highlight text according to its syntax, and turn the highlighting into HTML, XML or PDF output. It works with any file type which Vim itself can highlight. Usually Vim will be able to autodetect the file format based on the filename (and sometimes the contents of the file). Exactly one filename should be given on the command line to name the input file. If none is given input will instead be read from stdin (the standard input). If Vim can't guess the file type automatically, it can be specified explicitly using the "--filetype" option. For example: $ text-vimcolor --format html --filetype prolog foo.pl > foo.html This program is a command line interface to the Perl module Text::VimColor. OPTIONS
The following options are understood: --help Show a summary of the usage, including a list of options. --debug Turns on debugging in the underlying Perl module. This makes it print the command used to run Vim. --filetype file-type Set the type of the file explicitly. The file-type argument should be something which Vim will recognise when set with its "filetype" option. Examples are "perl", "cpp" (for C++) and "sh" (for Unix shell scripts). These names are case sensitive, and should usually be all-lowercase. --format output-format The output format to generate. Must be one of the following: html Generate XHTML output, with text marked with "<span>" elements with "class" attributes. A CSS stylesheet should be used to define the coloring, etc., for the output. See the "--full-page" option below. xml Output is in a simple XML vocabulary. This can then be used by other software to do further transformations (e.g., using XSLT). pdf XML output is generated and fed to the FOP XSL-FO processor, with an appropriate XSL style sheet. The stylesheet uses XSLT to transform the normal XML output into XSL-FO, which is then rendered to PDF. For this to work, the command "fop" must be available. An output file must be specified with "--output" with this format. Full details of the HTML and XML output formats can be found in the documentation for Text::VimColor. --output output-filename Specifies the name of the output file (which will end up containing either HTML, XML or PDF). If this option is omitted, the output will be sent to stdout (the standard output). This option is required when the output format is PDF (because of limitations in FOP). --full-page When the output format is HTML, this option will make the output a complete HTML page, rather than just a fragment of HTML. A CSS stylesheet will be inserted inline into the output, so the output will be useable as it is. --no-inline-stylesheet When the output format is HTML and "--fullpage" is given, a stylesheet is normally inserted in-line in the output file. If this option is given it will instead be referenced with a "<link>" element. --let name=value When Vim is run the value of name will be set to value using Vim's "let" command. More than one of these options can be set. The value is not quoted or escaped in any way, so it can be an expression. These settings take precedence over "--unlet" options. This option corresponds to the "vim_let" setting and method in the Perl module. --unlet name Prevent the value of name being set with Vim's "let" command. This can be used to turn off default settings. This option corresponds to the "vim_let" setting and method in the Perl module, when used with a value of "undef". BUGS
o The PDF output option often doesn't work, because it is dependent on FOP, which often doesn't work. This is also why it is mind numbingly slow. o FOP (0.20.3) seems to ignore the "background-color" property on "<fo:inline>". If that's what it's meant to do, how do you set the background color on part of a line? AUTHOR
Geoff Richards <qef@laxan.com> COPYRIGHT
Copyright 2002-2006, Geoff Richards. This program is free software; you can redistribute it and/or modify it under the same terms as Perl. perl v5.10.1 2006-02-19 TEXT-VIMCOLOR(1p)
All times are GMT -4. The time now is 01:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy