Sponsored Content
Top Forums Shell Programming and Scripting How to remove new line characters from data rows in a Pipe delimited file? Post 303041254 by styris on Tuesday 19th of November 2019 12:29:27 PM
Old 11-19-2019
How to remove new line characters from data rows in a Pipe delimited file?

I have a file as below

Code:
Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber
1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000
2345|FirstName2|MiddleName3|LastName4|
 Add1 || ADD2|
 234|000000000

OUTPUT :
Code:
Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber
1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000
2345|FirstName2|MiddleName3|LastName4| Add1 || ADD2|234|000000000


Last edited by RavinderSingh13; 11-19-2019 at 01:39 PM..
 

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

Remove SPACES between PIPE delimited file

This is my input file with extra information in the HEADER and leading & trailing SPACES between PIPE delimiter. 02/04/2010 Dynamic List Display 1 --------------------------------------------------------------------------------------... (6 Replies)
Discussion started by: srimitta
6 Replies

3. Shell Programming and Scripting

Selecting rows from a pipe delimited file based on condition

HI all, I have a simple challenge for you.. I have the following pipe delimited file 2345|98|1809||x|969|0 2345|98|0809||y|0|537 2345|97|9809||x|544|0 2345|97|0909||y|0|651 9685|98|7809||x|321|0 9685|98|7909||y|0|357 9685|98|7809||x|687|0 9685|98|0809||y|0|234 2315|98|0809||x|564|0 ... (2 Replies)
Discussion started by: nithins007
2 Replies

4. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

5. UNIX for Dummies Questions & Answers

find string and get the rest of the line in a pipe delimited file

Hi friends, I have a file where I should search for a string and get the rest of the line but without the delimiter using awk. for example I have the series of string in a file: input_string.txt bbb ccc aaa and the mapping file looks like this. mapping.txt aaa|12 bbb|23 ccc|43... (11 Replies)
Discussion started by: kokoro
11 Replies

6. Shell Programming and Scripting

Find for line with not null values at nth place in pipe delimited file

Hi, I am trying to find the lines in a pipe delimited file where 11th column has not null values. Any help is appreciated. Need help asap please. thanks in advance. (3 Replies)
Discussion started by: manikms
3 Replies

7. Shell Programming and Scripting

Remove few columns from pipe delimited file

I have file as below column1|column2|column3|column4|column5| fill1|fill2|fill3|fill4|fill5| abc1|abc2|abc3|abc4|abc5| . . . . i need to remove column2,3, from that file column1|column4|column5| fill1|fill4|fill5| abc1|abc4|abc5| . . . (3 Replies)
Discussion started by: greenworld123
3 Replies

8. Shell Programming and Scripting

To remove duplicates from pipe delimited file

Hi some one please help me to remove duplicates from a pipe delimited file based on first two columns. 123|asdf|sfsd|qwrer 431|yui|qwer|opws 123|asdf|pol|njio Here My first record and last record are duplicates.As per my requirement I want all the latest records into one file. I want the... (12 Replies)
Discussion started by: ginrkf
12 Replies

9. Shell Programming and Scripting

How to remove alphabets/special characters/space in the 5th field of a tab delimited file?

Thank you for 4 looking this post. We have a tab delimited file where we are facing problem in a lot of funny character. I have tried using awk but failed that is not working. In the 5th field ID which is supposed to be a integer only of that file, we are getting corrupted data as below. I... (12 Replies)
Discussion started by: Srithar
12 Replies

10. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
BTOOL(1)						      General Commands Manual							  BTOOL(1)

NAME
btool - Barry Project's program to interface with BlackBerry handheld SYNOPSIS
btool [-B busname][-N devname][-a db][-c dn][-C dnattr][-d db [-f file][-F sortkey][-r#][-R#]-D#]][-h][-i charset][-l][-L][-m cmd][-M][-p pin][-P password][-s db -f file][-S][-t][-v][-V][-X][-z][-Z] DESCRIPTION
btool is a program that communicates with a BlackBerry device over USB; there is no intention to support ancient serial-port BlackBerries. Since the protocols used by BlackBerry are not documented by the manufacturer Research In Motion, this program is experimental and you use at own risk. Be sure your device is backed up by another program if it contains important data. OPTIONS
-B busname Specify the USB bus to search for Blackberry devices on. This is the first number displayed in the output from the lsusb command, such as 002. If the busname is numeric on your system, 2 and 002 are equal. See also the -N option, which can be used together with this option to precisely select the device to work with. -a db Delete all records from specified database. This can be used multiple times to clear multiple databases. -c dn Convert address book database to LDIF format, using the specified dn as the baseDN. Sends LDIF output to stdout. -C dnattr Spcify LDIF attribute name to use when building the FQDN in the dn attribute. Defaults to 'cn'. If you modify the mapping with the -m switch, make sure that the new dnattr exists. -d db Load database 'db' FROM device and dump to stdout. Can be used multiple times to fetch more than one database. See the -t option for a list of device databases. -e epp Override endpoint pair detection. 'epp' is a single string separated by a comma, holding the read,write endpoint pair. Example: -e 83,5 Note: Endpoints are specified in hex. Use the same numbers given by the lsusb -v output. You should never need to use this option, as endpoints are autodetected. -f file Filename to write or read handheld data to/from. Used in conjunction with the -d and -s options, respectively. Note: the file for- mat of this file is not backward compatible between devel releases. -F sortkey Sort the -d database output according to the given sortkey. Note that the format of this field is special: 'DBName:field1,field2' It contains no spaces, unless the spaces are part of the name. This option can be used multiple times, to match your -d options. Example: If you used the following command: btool -d 'Address Book' You could use the following sort key to sort by Company name first, with a subsort of last and first names. -F 'Address Book:Company,LastName,FirstName' -i charset Specifies the iconv charset to use for converting international strings. The Blackberry uses the WINDOWS-1252 charset, which is incompatible with the more common code pages used in Linux. The most useful charset to use with this option is UTF-8, and is highly recommended. Any other charset available via 'iconv --list' can be used here too, but may not be successful for some character con- versions. -I Sort records before dumping them to stdout. This uses the default library sorting order, which is specific to each database. -l Lists attached Blackberry devices, and their PIN numbers. -L List Contact field names. Each name represents a contact field that the Barry library recognizes. Use these names with the -m option to adjust the LDIF name to field mapping. -m command Map LDIF name to Contact field, or unmap LDIF name. To map a new or existing LDIF attribute name to a Barry contact field, use the format 'ldif,read,write' where ldif represents the name of the attribute to map, read is the contact field name used to read data from the record, and write is the contact field name used to write data to the record. To unmap an LDIF name, specify the LDIF attribute alone. For example, to map a new LDIF attribute called "strange" to read from FirstName and write to LastName, use: -m strange,FirstName,LastName The -m option can be specified multiple times to create the desired mapping. -M List current LDIF mapping to stdout. -N devname Specify the USB device name. This is the second number displayed in the output from the lsusb command, such as 005. If the device name is numeric on your system, 5 and 005 are equal. See also the -B option. -p pin PIN of device to talk with. Only needed if you have more than one Blackberry connected at once. -P password Simplistic method to specify device password. In a real application, this would be done using a more secure prompt. -s db Save database 'db' TO device from data loaded from -f file. See the -t option for a list of device databases. -S Show list of supported database parsers and builders. Parsers are used when reading data out of the device, and builders are used when writing data to the device. If a parser is supported, but its associated builder is not, that means you cannot change the database programmatically, such as with the -s option. -t Show device's database table. -T db Show record state table for given database. -v Dump verbose protocol data during operation. -V Enable vformat MIME output where available. Address Book gets printed in vCard format, Calendar in vEvent format, Memos in vJour- nal, and Tasks in vTodo, etc. -X Perform a USB reset on the device. Similar to the breset command, and does a virtual "replug" of the device. -z Use non-threaded sockets when communicating with the device. This is the behaviour seen in versions 0.12 and earlier, since threads were not yet supported. This option, along with -Z, are for debugging and testing. -Z Use a threaded socket router when communicating with the device. This is the default for btool. This option, along with -Z, are for debugging and testing. -h, --help Show summary of options. DATABASE COMMAND MODIFIERS
The following options modify the -d command option above, and can be used multiple times for more than one record. -r # Fetch specific record, given a record index number as seen in the -T state table. Can be used multiple times to fetch specific records from a single database. -R # Same as -r, but also clears the record's dirty flags. -D # Delete the specified record using the index number as seen in the -T state table. AUTHOR
btool is part of the Barry project. This manual page was written by Ian Darwin and Chris Frey. SEE ALSO
http://www.netdirect.ca/software/packages/barry Especially the caveats, and the call for developers and others to help with the project. February 3, 2012 BTOOL(1)
All times are GMT -4. The time now is 03:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy