Sponsored Content
Top Forums Shell Programming and Scripting Reformatting single column text file starting new line when finding particular string Post 302566946 by kieranfoley on Friday 21st of October 2011 01:39:56 PM
Old 10-21-2011
Thanks again but that code is only printing the IP addresses.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding a certain string on each line in a file

Hi, I need a script to get every line from a file where there are less then 17 ; on a line. Thank's (5 Replies)
Discussion started by: VODAFUN
5 Replies

2. Shell Programming and Scripting

Finding a string in a text file and posting part of the line

What would be the most succinct way of doing this (preferably in 1 line, maybe 2): searching the first 10 characters of every line in a text file for a specific string, and if it was found, print out characters 11-20 of the line on which the string was found. In this case, it's known that there... (13 Replies)
Discussion started by: busdude
13 Replies

3. Shell Programming and Scripting

Finding the last column value from a text file

Hi, I need to find out the last column value from a text file which is delimited by a tab. The issue here is the last column# for each record can be different i.,e, 1st record can have the last column as 15 and the second record can have the last column as "17". I have to search a string... (3 Replies)
Discussion started by: naveen_sangam
3 Replies

4. Shell Programming and Scripting

Finding the second last column value from a text file

Can any one tell me how to get the second last column value from the text file, which has different record size for each record. I know how to get the last column using awk and print statements, but I am unable to get the second last column value from the file. (4 Replies)
Discussion started by: naveen_sangam
4 Replies

5. Shell Programming and Scripting

replace (sed?) a single line/string in file with multiple lines (string) from another file??

Can someone tell me how I can do this? e.g: Say file1.txt contains: today is monday the 22 of NOVEMBER 2010 and file2.txt contains: the 11th month of How do i replace the word NOVEMBER with (5 Replies)
Discussion started by: tuathan
5 Replies

6. Shell Programming and Scripting

Help for reformatting text file and creating new format

Hi all, I have an input file like 1,date,company,, 1,date,comapny,, 2,000,,,567,ACT,00,,,,KKG,M1,D45,,67J,+4500000000 2,000,,,567,ACT,00,,,,KKG,M6,D49,,56J,+6000 2,000,,,567,ACT,00,,7,,KKG,M3,D58,,68h,-70000 2,000,,,567,ACT,00,,,,KKG,M9,D95,,34m,0.00 3,total what i require is 1.I... (2 Replies)
Discussion started by: selvankj
2 Replies

7. UNIX for Dummies Questions & Answers

Sort text file starting at column X

Hello everyone! As the heading reads, I would like to sort the lines of a text file, starting at a specific column (i.e. skip the first X characters of each line). What I’m actually trying to sort is the md5 sums file of a directory. Every time I copy a new file to that directory, I perform... (3 Replies)
Discussion started by: iznogoud
3 Replies

8. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

9. Shell Programming and Scripting

search a string in a particular column of file and return the line number of the line

Hi All, Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example : abc.txt 7000,john,2,1,0,1,6 7001,elen,2,2,0,1,7 7002,sami,2,3,0,1,6 7003,mike,1,4,0,2,1 8001,nike,1,5,0,1,8... (3 Replies)
Discussion started by: arunshankar.c
3 Replies

10. UNIX for Dummies Questions & Answers

Append a line to single column text file

I would like to add a line to the end of a single column text file. How do I go about doing that? Input: BEGIN 1 2 3 Output: BEGIN 1 2 3 END Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
tbl(1)							      General Commands Manual							    tbl(1)

NAME
tbl - format tables for nroff SYNOPSIS
[file ...] DESCRIPTION
is a preprocessor that formats tables for nroff(1). The input files are copied to the standard output, except for lines between and com- mand lines, which are assumed to describe tables and are re-formatted by (The and command lines are not altered by is followed by global options. The available global options are: center the table (default is left-adjust); make the table as wide as the current line length; enclose the table in a box; enclose the table in a double box; enclose each item of the table in a box; use the character x instead of a tab to separate items in a line of input data. The global options, if any, are terminated with a semi-colon Next come lines describing the format of each line of the table. Each such format line describes one line of the actual table, except that the last format line (which must end with a period) describes all remaining lines of the table. Each column of each line of the table is described by a single key-letter, optionally followed by specifiers that determine the font and point size of the corresponding item, indi- cate where vertical bars are to appear between columns, or determine column width, inter-column spacing, etc. The available key-letters are: center item within the column; right-adjust item within the column; left-adjust item within the column; numerically adjust item in the column: units positions of numbers are aligned vertically; span previous item on the left into this column; center longest line in this column, then left-adjust all other lines in this column with respect to that centered line; span down previous entry in this column; replace this entry with a horizontal line; replace this entry with a double horizontal line. The characters and stand for the bold (font position 3) and italic (font position 2) fonts, respectively; the character indicates a verti- cal line between columns. The format lines are followed by lines containing the actual data for the table, followed finally by Within such data lines, data items are normally separated by tab characters. If a data line consists of only or a single or double line, respectively, is drawn across the table at that point; if a single item in a data line consists of only or then that item is replaced by a single or double line. The option forces to use only full vertical line motions, making the output more suitable for devices that cannot generate partial vertical line motions (such as line printers). If no file names are given as arguments (or if is specified as the last argument), reads the standard input, and thus can be used as a fil- ter. When used with should be used first to minimize the volume of data passed through pipes (see neqn(1)). EXTERNAL INFLUENCES
Environment Variables determines the interpretation of text as single- and/or multi-byte characters. determines the radix character used in numerical data. determines the language in which messages are displayed. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization vari- able contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multi-byte character code sets are supported. EXAMPLES
If we redefine the tab character to a semicolon, then the input: yields: +------------------------------+ | Household Population | +--------------+---------------+ | Town | Households | | | Number Size | +--------------+---------------+ |Bedminster | 789 3.26 | |Bernards Twp. | 3087 3.74 | |Bernardsville | 2018 3.30 | |Bound Brook | 3425 3.04 | |Bridgewater | 7897 3.81 | |Far Hills | 240 3.19 | +--------------+---------------+ The command is used most often with and (see col(1)). A common usage is: WARNINGS
See WARNINGS under nroff(1). SEE ALSO
col(1), mm(1), neqn(1), nroff(1), soelim(1), mm(5). tbl(1)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy