Sponsored Content
Top Forums Shell Programming and Scripting How to remove alphabets/special characters/space in the 5th field of a tab delimited file? Post 302900808 by Srithar on Thursday 8th of May 2014 08:02:46 PM
Old 05-08-2014
Hi DON,

Thanks for you reply. It helped me a lot. But that is not working for one scenario. If that corrupted records is splitted into 3 lines (as mentioned in example) then it is removing the entire data in the 5th field & also from the successive fields. Let's see some examples:

Input:

Code:
Record 1 :
"14"	"50603"	"1012"	"2131609"	"18��#��nz�S^l�����
��`��Z�/á*”�������ˮ7d_�gˉ�RB�nx����R�
9gd,�P�X�O"	"02-May-2014 04:11:54"

Expected Output:
Code:
Record 1 :
"14"	"50603"	"1012"	"2131609"	""	"02-May-2014 04:11:54"

Actual Output: (6th field is cutted from the row)
Code:
Record 1 :
"14"	"50603"	"1012"	"2131609"	""

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Converting Space delimited file to Tab delimited file

Hi all, I have a file with single white space delimited values, I want to convert them to a tab delimited file. I tried sed, tr ... but nothing is working. Thanks, Rajeevan D (16 Replies)
Discussion started by: jeevs81
16 Replies

2. Shell Programming and Scripting

insert a field into a tab delimited file

Hello, Can someone help me to do this with awk or sed? I have a file with multiple lines, each line has many fields separated with a tab. I would like to add one more field holding 'na' in between the first and second fields. old file looks like, 1, field1 field2 field3 ... 2, field1... (7 Replies)
Discussion started by: ssshen
7 Replies

3. UNIX for Dummies Questions & Answers

Insert Field into a tab-delimited file

Hello, I have about 100 files in a directory with fields which are tab delimited. I would like to append the file name as the first field and it has to be done as many times as the total lines in the file. For example, myFile1.txt has the following data: 1 x y z 2 a b ... (5 Replies)
Discussion started by: Gussifinknottle
5 Replies

4. Shell Programming and Scripting

Merging files into a single tab delimited file with a space separating

I have a folder that contains say 50 files in a sequential order: cdf_1.txt cdf_2.txt cdf_3.txt cdf_3.txt . . . cdf_50.txt. I need to merge these files in the same order into a single tab delimited file. I used the following shell script: for x in {1..50}; do cat cdf_${x}.txt >>... (3 Replies)
Discussion started by: Lucky Ali
3 Replies

5. Shell Programming and Scripting

Remove the special characters from field

Hi, In source data few of columns are having special charates(like *) due to this i am not able to display the data into flat file.it's displaying the some of junk data into the flat file. source dataExample: Address1="XDERFTG * HYJUYTG" how to remove the special charates in a string (2 Replies)
Discussion started by: koti_rama
2 Replies

6. UNIX for Dummies Questions & Answers

Changing only the first space to a tab in a space delimited text file

Hi, I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

7. Shell Programming and Scripting

How to make tab delimited file to space delimited?

Hi How to make tab delimited file to space delimited? in put file: ABC kgy jkh ghj ash kjl o/p file: ABC kgy jkh ghj ash kjl Use code tags, thanks. (1 Reply)
Discussion started by: jagdishrout
1 Replies

8. Shell Programming and Scripting

How to convert space&tab delimited file to CSV?

Hello, I have a text file with space and tab (mixed) delimited file and need to convert into CSV. # cat test.txt /dev/rmt/tsmmt32 HP Ultrium 6-SCSI J3LZ 50:03:08:c0:02:72:c0:b5 F00272C0B5 0/0/6/1/1.145.17.255.0.0.0 /dev/rmt/c102t0d0BEST /dev/rmt/tsmmt37 ... (6 Replies)
Discussion started by: prvnrk
6 Replies

9. Shell Programming and Scripting

Remove blank columns from a tab delimited text file

Hello, I have some tab delimited files that may contain blank columns. I would like to delete the blank columns if they exist. There is no clear pattern for when a blank occurs. I was thinking of using sed to replace instances of double tab with blank, sed 's/\t\t//g' All of the examples... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

10. Shell Programming and Scripting

Output file with <Tab> or <Space> Delimited

Input file: xyz,pqrs.lmno,NA,NA,NA,NA,NA,NA,NA abcd,pqrs.xyz,NA,NA,NA,NA,NA,NA,NA Expected Output: xyz pqrs.lmno NA NA NA NA NA NA NA abcd pqrs.xyz NA NA NA NA NA NA NA Command Tried so far: awk -F"," 'BEGIN{OFS=" ";} {print}' $File_Path/File_Name.csv Issue:... (5 Replies)
Discussion started by: TechGyaann
5 Replies
realm(3pm)						User Contributed Perl Documentation						realm(3pm)

NAME
Realm - Realm-related data used by DNSSEC-Tools programs. DESCRIPTION
The DNSSEC-Tools dtrealms command manages a group of distinct rollover environments running on a single host. These distinct rollover environments are called realms. dtrealms uses a realm file to properly create and manage each of its realms. A realms file is organized in sets of realm records. Each realm record describes the execution environment of a single rollover instance. A realm consists of a set of keyword/value entries. The DNSSEC-Tools realm.pm module manipulates the contents of a realm file. Module interfaces exist for looking up realm records, creating new records, and modifying existing records. Comment lines and blank lines are ignored by the DNSSEC-Tools programs. Comment lines start with either a '#' character or a ';' character. A realm's name may consist of alphabetic characters, numbers, and several special characters. The special characters are the minus sign, the plus sign, the underscore, the comma, the period, the colon, the forward-slash, the space, and the tab. This name is an identifier. The values in a realm's entries may consist of alphabetic characters, numbers, and several special characters. The special characters are the minus sign, the plus sign, the underscore, the comma, the period, the colon, the forward-slash, the space, and the tab. REALM FIELDS
The fields in a realm record are: * administrator This is the email address for the realm's administrative user. * args The user-specified arguments for the rollover manager. This is not a required field. * configdir This field contains the name of the directory in which dtrealms will find the realm's configuration information. This directory must contain a subdirectory named dnssec-tools, and the realm's configuration file will be stored there. This is a required field. * display This boolean field indicates whether or not the realm should be displayed by the grandvizier program. This is an optional field. * hoard This field contains the pathname to a collection of files used to build a realm. This field is only used by the buildrealms program. * manager This field contains the name of the rollover manager program for the realm. If this is not defined, then rollerd will be used. * realmdir This field contains the name of the directory in which dtrealms will execute the realm's rollover manager. This is a required field. * rollrec The realm's rollrec file. This file will be used by the rollover manager to control the rollover environment. * state This field contains the realm's state. It must be either "active" or "inactive". * statedir This field contains the name of the directory in which rollerd and other DNSSEC-Tools programs will find the realm's state information. If this is not specified, the configdir directory will be used. * user This field contains the name of the user that the realm will be executed as. This is an optional field. This is not yet implemented in dtrealms. EXAMPLES
The following are examples of realms: realm "example" state "active" configdir "/realms/configs/example" statedir "/realms/states/example" realmdir "/realms/realms/example" rollrec "demo-example.rollrec" administrator "zonefolks@example.com" display "1" manager "rollerd" args "-sleep 600 -loglevel phase -logfile log.example" user "zonemgr" realm "testing" state "inactive" configdir "/realms/configs/testing" realmdir "/realms/realms/testing" rollrec "demo-testing.rollrec" display "1" manager "rollerd-tester" args "-sleep 60 -loglevel tmi -logfile log.testing" COPYRIGHT
Copyright 2012 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details. AUTHOR
Wayne Morrison, tewok@tislabs.com SEE ALSO
buildrealms(8), dtrealms(8), grandvizier(8), lsrealm(8), realmchk(8), realminit(8) Net::DNS::SEC::Tools::keyrec(3), Net::DNS::SEC::Tools::rollrec(3) keyrec(5) perl v5.14.2 2012-06-14 realm(3pm)
All times are GMT -4. The time now is 01:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy