Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to remove the delimiter from the column value within a file? Post 302982262 by gandolf989 on Tuesday 27th of September 2016 09:50:11 AM
Old 09-27-2016
You might be able to do a three pass solution where you change the ^@ in the email addresses first to something temporary, then change everything else, then go back and change the temporary characters to what you want. Are all of the email addresses .com? or are there any .edu or .org. That might help to simplify the problem.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to read the first column in a flat file with ~ as delimiter

I have one flat file like below id1~col~batch1 id2~col2~batch2 id3~col3~batch3 I need to read the first column one by one and I need to write one db2 query based on that column1 Like for (i=0;i<=10;i++) do insert into table column (con_id) values (select column from table where... (4 Replies)
Discussion started by: siri_886
4 Replies

2. Shell Programming and Scripting

Remove first column from file

Hi, This is how data in test.txt file | |abc|zxcv|xy12| | |cvs|zzvc|a23p| How can remove first column. abc|zxcv|xy12| cvs|zzvc|a23p| Thanks srimitta (8 Replies)
Discussion started by: srimitta
8 Replies

3. Shell Programming and Scripting

rearrange the column names with comma as column delimiter

Hi, I am new to shell scripting, i have requirement can any one help me out in this regrads, in directory i have file like invoice1.txt, invoice2.txt in each file i have fixed number of columns, 62 in number but they are randomly arranged.like for first file invoice1.txt can have columns... (5 Replies)
Discussion started by: madhav62
5 Replies

4. Shell Programming and Scripting

How to remove delimiter from specific column?

I have 5 column in sample txt file where in i have to create report based upon 1,3 and 5 th column.. I have : in first and third coulmn. But I want to retain the colon of fifth coulmn and remove the colon of first column.. 5th column contains String message (for example,... (7 Replies)
Discussion started by: Shirisha
7 Replies

5. Shell Programming and Scripting

How to avoid Delimiter occuring in column values in .csv file

Hello Gurus, I need to create a file from a .csv file extracting specific columns only. File structure is Column1,Column2,Column3,Column4 abcd,1234,"asdf, tew,123",123456 efgh,234,asdf,654321 My output file should have abcd,123456 efgh,654321 Can you pls help me with the code. ... (10 Replies)
Discussion started by: ritesh.bhawsar
10 Replies

6. Shell Programming and Scripting

Shell script to put delimiter for a no delimiter variable length text file

Hi, I have a No Delimiter variable length text file with following schema - Column Name Data length Firstname 5 Lastname 5 age 3 phoneno1 10 phoneno2 10 phoneno3 10 sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 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

Perl Code to change file delimiter (passed as argument) to bar delimiter

Hi, Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters. Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies

9. Shell Programming and Scripting

Replace delimiter for a particular column in a pipe delimited file

I have an input file as below Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber 1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000 Output : 1234|FirstName1|MiddleName2|LastName3| Add1 ,, ADD2|123|000000000 OR 1234,FirstName1,MiddleName2,LastName3, Add1 ||... (2 Replies)
Discussion started by: styris
2 Replies
tbl-dctrl(1)						   Debian administrator's manual					      tbl-dctrl(1)

NAME
tbl-dctrl - generate tabular representations of data in dctrl format SYNOPSIS
tbl-dctrl [ options ] [ -c column-specification ... ] [ filename ] ... tbl-dctrl --version tbl-dctrl --help DESCRIPTION
tbl-dctrl creates tabular representations of data given to it in Debian control file format. By default, tbl-dctrl reads the whole database, looking for the longest entry in each requested column; it then outputs a table, with bor- ders and column titles, where each column is just wide enough to fit the longest entry. Most of this behaviour can be customized as described below. A column is requested by specifying the -c (--column) switch with a column specification. The simplest kind of a column specification con- sists solely of the name of a field. In such a case, tbl-dctrl will include in the output a column whose title is the literal column spec- ification and whose data is drawn from fields with that name. If no -c options are given, tbl-dctrl will use all fields in the input in the order in which they first appear. There are two optional additions one can make to a column specification. Prefixing the field name with some text followed by an equality sign (for example, -c 'Package name=Package') modifies the column in such a way that the text before the equality sign is used as the col- umn title, while the text after the equality sign is used as the name of the field from which data is drawn. One can also append a colon followed by a positive whole number to the field name. In such a case, the number after the colon specifies the width of the column. These two additions can be used separately or together. If there are more than one colon, the last one is significant. If there are more than one equals sign, the first one is significant. Other colons and equals signs are used simply as data. Note that the whole column specification must be given to tbl-dctrl as one argument, so if it contains spaces, it must be quoted for the shell. If all requested columns have a specified width, tbl-dctrl will produce output immediately, not waiting for the whole input to be read in. OPTIONS
-d delimiter, --delimiter=delimiter Instead of drawing nice borders to the table, use the specified delimiter string to delimit columns in a row. -H, --no-heading Do not print a table heading (column titles). -l level, --errorlevel=level Set log level to level. level is one of fatal, important, informational and debug, but the last may not be available, depending on the compile-time options. These categories are given here in order; every message that is emitted when fatal is in effect, will be emitted in the important error level, and so on. The default is important. -V, --version Print out version information. -C, --copying Print out the copyright license. This produces much output; be sure to redirect or pipe it somewhere (such as your favourite pager). -h, --help Print out a help summary. OPERANDS
tbl-dctrl will read its input from the files named on the command line, in the specified order. A file called - represents the program's standard input stream. If no files are named, the program behaves as if - alone had been named, that is, input is read from the standard input stream. STDIN
The standard input stream may be used as input as specified above in the OPERANDS section. INPUT FILES
All input to tbl-dctrl is in the format of a Debian control file. A Debian control (dctrl) file is a semistructured single-table database stored in a machine-parseable text file. Such a database consists of a set of records; each record is a mapping from field names to field content. Textually, records are separated by empty lines, while each field is encoded as one or more nonempty lines inside a record. A field starts with its name, followed by a colon, followed by the field content. The colon must reside on the first line of the field, and the first line must start with no whitespace. Subsequent lines, in contrast, always start with linear whitespace (one or more space or tab characters). When input is read from multiple files, a record separator is implicit between two adjacent files. ENVIRONMENT VARIABLES
The standard locale environment, specifically its character set setting, affects the interpretation of input and output as character streams. ASYNCHRONOUS EVENTS
Standard UNIX signals have their usual meaning. STDOUT
All output is sent to the standard output stream. The output is a tabular representation of the input database restricted to the specified fields. Logically, the output is a table; when the -d option is used, this table is represented simply by separating columns in each row by the specified delimiter; when the option is not used, a frame is drawn around the table. The order of the columns is the same as the order of the column specifications on the command line. OUTPUT FILES
There are no output files. EXIT STATUS
This utility exits with 0 when successful. It uses a nonzero exit code inconsistently when an error is noticed (this is a bug). CONSEQUENCES OF ERRORS
In case of errors in the input, the output will be partially or completely garbage. In case of errors in invocation, the program will refuse to function. EXAMPLES
The following command line pipe outputs a table of all packages, with their maintainer data, sorted by the maintainer data, that have no content: % grep-available -FInstalled-Size --eq 0 | sort-dctrl -kMaintainer - | tbl-dctrl -cPackage -cMaintainer AUTHOR
The tbl-dctrl program and this manual page were written by Antti-Juhani Kaijanaho. SEE ALSO
apt-cache(1), ara(1), dpkg-awk(1), dpkg-query(1), grep-dctrl(1), sort-dctrl(1), dpkg(8) Debian Project 2006-04-02 tbl-dctrl(1)
All times are GMT -4. The time now is 12:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy