Sponsored Content
Top Forums Shell Programming and Scripting Remove the first character from the fourth column only if the column has four characters Post 302843331 by hasanabdulla on Monday 12th of August 2013 11:26:30 PM
Old 08-13-2013
Thanks for your answer. I need in-place editing. Is it possible?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove new line characters from a partcular column data

Dear friends, I have a pipe delimited file having 5 columns. However the column no-3 is having extra new line characters as the data owing to owing , I am having issues. Ideally my file should have only newline termination at the end of each record and not within column data of any of... (1 Reply)
Discussion started by: sureshg_sampat
1 Replies

2. Shell Programming and Scripting

How to manipulate first column and reverse the line order in third and fourth column?

How to manipulate first column and reverse the line order in third and fourth column as follws? For example i have a original file like this: file1 0.00000000E+000 -1.17555359E-001 0.00000000E+000 2.00000000E-002 -1.17555359E-001 0.00000000E+000 ... (1 Reply)
Discussion started by: Max Well
1 Replies

3. Shell Programming and Scripting

Use awk to have the fourth column with spaces

Hi Gurus, We have a ftpserver from which we do a dir command and output it to a local file. The content of the ftpfile is: 07-15-09 06:06AM 5466 ABC_123_ER19057320090714082723.ZIP 07-15-09 06:07AM 3801 ABC_123_ER19155920090714082842.ZIP 07-15-09 06:07AM ... (14 Replies)
Discussion started by: donisback
14 Replies

4. Shell Programming and Scripting

need to remove duplicates based on key in first column and pattern in last column

Given a file such as this I need to remove the duplicates. 00060011 PAUL BOWSTEIN ad_waq3_921_20100826_010517.txt 00060011 PAUL BOWSTEIN ad_waq3_921_20100827_010528.txt 0624-01 RUT CORPORATION ad_sade3_10_20100827_010528.txt 0624-01 RUT CORPORATION ... (13 Replies)
Discussion started by: script_op2a
13 Replies

5. Shell Programming and Scripting

remove special character from a specific column

Hello , i have a text file like this : A123 c12AB c32DD aaaa B123 23DS 12QW bbbb C123 2GR 3RG cccccc i want to remove the numbers from second and third column only. i tried this : perl -pe 's///g' file.txt > newfile.txt but it will remove the number from... (7 Replies)
Discussion started by: shelladdict
7 Replies

6. Shell Programming and Scripting

replace by match on fourth column

Hi friends, My input file is this way chr1 100 200 "abc" chr1 350 400 "abc" chr2 450 600 "def" chr2 612 780 "def" How do I make this file into chr1 100 400 "abc" chr2 450 780 "def" This is basically matching on the fourth column and taking the minimum of second column and the... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

7. Shell Programming and Scripting

Remove the values from a certain column without deleting the Column name in a .CSV file

(14 Replies)
Discussion started by: dhruuv369
14 Replies

8. Shell Programming and Scripting

[Solved] Extract First character in fourth column

Hi Experts, I am new to UNIX. One of my file records are like below 220 IN C/A 515013 NULL NULL 220 IN C/A 515017 NULL NULL 225 IN C/A 333701 NULL NULL 225 IN C/A 515034 NULL NULL 225 IN C/A 499201 NULL NULL 225 IN C/A 499202 NULL NULL The above mentioned records delimiter is... (4 Replies)
Discussion started by: suresh_target
4 Replies

9. Shell Programming and Scripting

Remove character from a column in each line

Hi, I am a newbie to shell scripting (.sh). Please guide me on how to do the below issue. My input file has below data. I want to remove $ sysmbol from the fourth column of each line. (ie, between 4th and 5th pipe symbol) ABC25160|51497|06/02/2010|$32,192.07|MARK|$100|A... (3 Replies)
Discussion started by: rsreejithmenon
3 Replies

10. UNIX for Beginners Questions & Answers

Remove newline character from column spread over multiple lines in a file

Hi, I came across one issue recently where output from one of the columns of the table from where i am creating input file has newline characters hence, record in the file is spread over multiple lines. Fields in the file are separated by pipe (|) delimiter. As header will never have newline... (4 Replies)
Discussion started by: Prathmesh
4 Replies
adjust(1)						      General Commands Manual							 adjust(1)

NAME
adjust - simple text formatter SYNOPSIS
column] tabsize] [files]... DESCRIPTION
The command is a simple text formatter for filling, centering, left and right justifying, or only right justifying text paragraphs, and is designed for interactive use. It reads the concatenation of input files (or standard input if none are given) and produces on standard output a formatted version of its input, with each paragraph formatted separately. If is given as an input filename, reads standard input at that point (use as an argument to separate from options.) reads text from input lines as a series of words separated by space characters, tabs, or newlines. Text lines are grouped into paragraphs separated by blank lines. By default, text is copied directly to the output, subject only to simple filling (see below) with a right mar- gin of 72, and leading spaces are converted to tabs where possible. Options The command recognizes the following command-line options: Do not convert leading space characters to tabs on output; (output contains no tabs, even if there were tabs in input). Center text on each line. Lines are pre- and post-processed, but no filling is performed. Justify text. After filling, insert spaces in each line as needed to right justify it (except in the last line of each paragraph) while keeping the justified left margin. After filling text, adjust the indentation of each line for a smooth right margin (ragged left margin). Set the right fill margin to the given column number, instead of 72. Text is filled, and optionally right justified, so that no output line extends beyond this column (if possible). If is given, the current right margin of the first line of each paragraph is used for that and all subsequent lines in the para- graph. By default, text is centered on column 40. With the option sets the middle column of the centering "window", but auto- sets the right side as before (which then determines the center of the "window"). Set the tab size to other than the default (eight columns). Only one of the and options is allowed in a single command line. Details Before doing anything else to a line of input text, first handles backspaces, rubbing out preceding characters in the usual way. Next, it ignores all nonprintable characters except tab. It then expands all tabs to spaces. For simple text filling, the first word of the first line of each paragraph is indented the same amount as in the input line. Each word is then carried to the output followed by one space. "Words" ending in terminal_character[quote][closing_character] are followed by two spa- ces, where terminal_character is any of or quote is a single closing quote or double-quote character (), and close is any of or Here are some examples: does not place two spaces after a pair of single closing quotes following a terminal_character). starts a new output line whenever adding a word (other than the first one) to the current line would exceed the right margin. understands indented first lines of paragraphs (such as this one) when filling. The second and subsequent lines of each paragraph are indented the same amount as the second line of the input paragraph if there is a second line, else the same as the first line. also has a rudimentary understanding of tagged paragraphs (such as this one) when filling. If the second line of a paragraph is indented more than the first, and the first line has a word beginning at the same indentation as the second line, the input column position of the tag word or words (prior to the one matching the second line indentation) is preserved. Tag words are passed through without change of column position, even if they extend beyond the right margin. The rest of the line is filled or right justified from the position of the first nontag word. When is given, uses an intelligent algorithm to insert spaces in output lines where they are most needed, until the lines extend to the right margin. First, all one space word separators are examined. One space is added to each separator, starting with the one having the most letters between it and the preceding and following separators, until the modified line reaches the right margin. If all one space separators are increased to two spaces and more spaces must be inserted, the algorithm is repeated with two space separators, and so on. Output line indentation is held to one less than the right margin. If a single word is larger than the line size (right margin minus indentation), that word appears on a line by itself, properly indented, and extends beyond the right margin. However, if is used, such words are still right justified, if possible. If the current locale defines class names and (see iswctype(3C)), formats the text in accordance with the character classification and mar- gin settings (see and options). EXTERNAL INFLUENCES
Environment Variables provides a default value for the internationalization variables that are unset or null. If is unset or null, the default value of "C" (see lang(5)) is used. If any of the internationalization variables contains an invalid setting, will behave as if all internationalization variables are set to "C". See environ(5). If set to a nonempty string value, overrides the values of all the other internationalization variables. determines the interpretation of text as single and/or multi-byte characters, the classification of characters as printable, and the char- acters matched by character class expressions in regular expressions. determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informa- tive messages written to standard output. determines the location of message catalogs for the processing of International Code Set Support Single- and multi-byte character code sets are supported. DIAGNOSTICS
complains to standard error and later returns a nonzero value if any input file cannot be opened (it skips the file). It does the same (but quits immediately) if the argument to or is out of range, or if the program is improperly invoked. Input lines longer than are silently split (before tab expansion) or truncated (afterwards). Lines that are too wide to center begin in column 1 (no leading spaces). EXAMPLES
This command is useful for filtering text while in vi(1). For example, reformats the rest of the current paragraph (from the current line down), evening the lines. The command: (where denotes control characters) sets up a useful "finger macro". Typing (Ctrl-X) reformats the entire current paragraph. is a simple way to break text into separate words without whitespace, except for tagged-paragraph tags. WARNINGS
This program is designed to be simple and fast. It does not recognize backslash to escape whitespace or other characters. It does not recognize tagged paragraphs where the tag is on a line by itself. It knows that lines end in newline or null, and how to deal with tabs and backspaces, but it does not do anything special with other characters such as form feed (they are simply ignored). For complex opera- tions, standard text processors are likely to be more appropriate. This program could be implemented instead as a set of independent programs, fill, center, and justify (with the option). However, this would be much less efficient in actual use, especially given the program's special knowledge of tagged paragraphs and last lines of para- graphs. AUTHOR
was developed by HP. SEE ALSO
nroff(1). adjust(1)
All times are GMT -4. The time now is 08:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy