Sponsored Content
Top Forums UNIX for Dummies Questions & Answers how to remove mutilple enrty in a single line in unix Post 302291650 by zaxxon on Thursday 26th of February 2009 04:44:01 AM
Old 02-26-2009
Assuming that it is always the same fields that have to be replaced:

Code:
awk -F"," '{sub(/.*/,"",$6); sub(/.*/,"",$21); print}' OFS="," infile
subsD,01 02 03 04 05 00 00 00 00 07 00 05,hlr,common,00000000 subsD,,hlr,01,baoc|notActive|notInduced,activeAndOperative,notActive,notActive,noneDesignated,0,notActive| 00|,notActive|00|,notActive|00|,notActive|00|30|,, subsD,,hlr,02,baoc|notActive|notInduced,notActive,notActive,notActive,noneDesignated,0,notActive|00|,notAc tive|00|,notActive|00|,notActive|00|30|,,

 

10 More Discussions You Might Find Interesting

1. Programming

remove single-line comment

Does anyone knows how to write a program to remove single-line comment in C program? that means it don't read anything behind // (3 Replies)
Discussion started by: Icy002
3 Replies

2. UNIX for Dummies Questions & Answers

Trying to remove single character from a line

Here is a sample code grep '903' -i user.txt | tail -2 | awk '{print $2}' | sed 's/B//g' the input file has data as such 903-xxx-xxxxB 903-xxx-xxxxB It is a dialer file i want to remove the "B" any help thanks (5 Replies)
Discussion started by: Iz3k34l
5 Replies

3. UNIX for Dummies Questions & Answers

run command Unix on a single line

Hi everybody.. I need to enter in bash mode and then run a command and this just in a single command line. I tried : "bash ^M| somecommand" but nothing.. How do I do to simulate the return button just right after the bash command ? Thanks.. (8 Replies)
Discussion started by: Riddick61
8 Replies

4. Shell Programming and Scripting

Single/Multiple Line with Special characters - Find & Replace in Unix Script

Hi, I am creating a script to do a find and replace single/multiple lines in a file with any number of lines. I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE print $FIND gives Hi How r $u Rahul() Note:... (0 Replies)
Discussion started by: r_sarnayak
0 Replies

5. Shell Programming and Scripting

Single command for add 2 columns and remove 2 columns in unix/performance tuning

Hi all, I have created a script which adding two columns and removing two columns for all files. Filename: Cust_information_1200_201010.txt Source Data: "1","Cust information","123","106001","street","1-203 high street" "1","Cust information","124","105001","street","1-203 high street" ... (0 Replies)
Discussion started by: onesuri
0 Replies

6. UNIX for Advanced & Expert Users

unix command for terminal - view sequences as a single line?

Hello, I'm looking for some code that will list sequences of files as a single line. ie, sequences of files like this: filename.1.ext filename.2.ext filename.3.ext filename.4.ext filename.5.ext filename.6.ext filename.7.ext filename.8.ext filename.9.ext filename.10.ext would... (6 Replies)
Discussion started by: kentm
6 Replies

7. 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

8. UNIX for Dummies Questions & Answers

Remove multi line and single line comments

Hi, I am trying to remove multi line and single line comments like examples below I have tried this pattern. it works fine for single line comments and multi line comments in a single line only. but this fails when the comments are extended in multiple lines as shown in the comment 2 of... (3 Replies)
Discussion started by: ahmedwaseem2000
3 Replies

9. Shell Programming and Scripting

Remove single-line breaks only in document

Regarding copy/pasted text of copyright-free book from archive.org (link below), in attempt to expand single-line-break paragraph text (not section headings or paragraph breaks) to wider right margin, Justify or Wrap in LIbreOffice is not working, and Find/Replace the paragraph mark ($) wraps all... (2 Replies)
Discussion started by: p1ne
2 Replies

10. Shell Programming and Scripting

Remove single @ on line from file

Hi All, So I have to remove all the @hostnames from a file, the problem is, there are instances where @ is used for other things... For example: example text: @This is some text in between some at signs@ @This is some more text@ This is a line that will contain a username and his/her... (5 Replies)
Discussion started by: joeg1484
5 Replies
UNROFF(1)						      General Commands Manual							 UNROFF(1)

NAME
unroff - convert troff documents to plain text SYNTAX
unroff [ -E ] [ -J ] [ -8 ] [ -mxx ] [ file ... ] DESCRIPTION
unroff processes documents written to be formatted with troff (or nroff, or any of the other *roff variants) and converts them to plain text. This is similar to what deroff does, but the result is sometimes better than deroff output. Optional flags may be given to modify the operation of unroff, as follows: -E Echo input tokens as they are read. Useful mainly for debugging. -J Join output lines that would be part of a single paragraph so they form a single output line. This is useful if you plan to move the resulting output into a document formatter that treats paragraphs as a single line. The default is to do line wrapping accord- ing to the line length specified in the input document. -8 Write 8-bit ISO Latin-1 (ISO 8859-1) characters. This option may be useful for producing output intended to be viewed on devices capable of 8-bit character display. Without this option, 8-bit Latin-1 characters will generall appear in the output as ``[[name]]'' where ``name'' is the troffcvt internal name for the character, e.g., ``[[Aacute]]''. For some of these characters, an ASCII approximation will be used if something reasonably close is available. -mxx Specify macro package, usually -man, -me, -mm, or -ms. DIAGNOSTICS
line length clipped to nnn chars. A very long line length was requested, so long that it would likely result in output line assembly buf- fer overflow. The length is clipped to prevent this. output buffer capacity exceeded. This means some line is so long that it couldn't be collected in the output line assembly buffer. Most likely this signals a bug in tc2text, since the length is supposed to be kept within reasonable bounds (see previous paragraph). SEE ALSO
troffcvt(1), tc2text(1) WHO-TO-BLAME Paul DuBois, dubois@primate.wisc.edu. BUGS
unroff doesn't do so well with tables, particularly tables with multiple-line cells. Table centering isn't handled. UNROFF(1)
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy