if possible can you please tell me how to replace only the header & trailer of the file rest of the records need to be the same
---------- Post updated 08-03-13 at 12:48 AM ---------- Previous update was 08-02-13 at 07:17 PM ----------
This command is actually replacing the value of all the records in the file.But I need to replace the value of header & trailer only .Please some one help here
Hi, I have two input files.
File1:
ID Name Place
1-234~name1~Newyork
1-34~name2~Boston
1-2345~name3~Hungary
File1 is a variable length file where each column is seperated by delimitter "~".
File2:
ID Country
1-34<<11 SPACES>>USA<<7 spaces>>
1-234<<10 SPACES>>UK<<8... (5 Replies)
Col1 Col2 Col3 Col4
12 Completed 08 0830
12 In Progress 09 0829
11 For F U 07 0828
Considering the file above, how could i replace the third column the most efficient way? The actual file size is almost 1G. I am... (10 Replies)
Hi, Iam new to unix. I have one input file .
Input file :
ID1~Name1~Place1
ID2~Name2~Place2
ID3~Name3~Place3
I need output such that only first column should change to fixed width column of 15 characters of length.
Output File:
ID1<<12 spaces>>Name1~Place1
ID2<<12... (5 Replies)
Hi,
How to output the duplicate record to another file. We say the record is duplicate based on a column whose position is from 2 and its length is 11 characters.
The file is a fixed width file.
ex of Record:
DTYU12333567opert tjhi kkklTRG9012
The data in bold is the key on which... (1 Reply)
Hi,
I have a fixed width text file without any header row. One of the columns contains a date in YYYYMMDD format.
If the original file contains 3 dates, I want my shell script to split the file into 3 small files with data for each date.
I am a newbie and need help doing this. (14 Replies)
Input eg:
Ouput Expected.
The #rd line had the unexpted new line, which need to be replaced with space.
I was planing to go with checking the length of each line using awk and if the length is less than the defeined limit, (12 in above case) will replace the newline with space.
... (5 Replies)
hi,
i have a fixed width file with multiple columns and need to print data using awk command.
i use: awk -F "|" '($5 == BH) {print $1,$2,$3}' <non_AIM target>.txt for a delimiter file.
but now i have a fixed width file like below:
7518 8269511BH 20141224951050N8262
11148 8269511BH... (5 Replies)
All,
I used to use following command to replace specific location in a fixed width file.
Recently looks like my command stopped working as intended. We are on AIX unix.
awk 'function repl(s,f,t,v)
{ return substr(s,1,f-1) sprintf("%-*s", t-f+1, v) substr(s,t+1) }
NR<=10 {... (3 Replies)
Hi Forum.
I tried searching for a solution using the internet search but I haven't been able to find any solution for what I'm trying to accomplish.
I have a fixed width column file where I need to search for any occurrences of "D0" in col pos.#1-2, 10-11, 20-21 and replaced it with "XD".
... (2 Replies)
Discussion started by: pchang
2 Replies
LEARN ABOUT CENTOS
ltdbtool
LTDBTOOL(1) CTDB - clustered TDB database LTDBTOOL(1)NAME
ltdbtool - manipulate CTDB's local TDB files
SYNOPSIS
ltdbtool [OPTION...] {COMMAND} [COMMAND-ARGS]
DESCRIPTION
ltdbtool is a utility to manipulate CTDB's local TDB databases (LTDBs) without connecting to a CTDB daemon.
It can be used to:
o dump the contents of a LTDB, optionally printing the CTDB record header information,
o convert between an LTDB and a non-clustered tdb by adding or removing CTDB headers and
o convert between 64 and 32 bit LTDBs where the CTDB record headers differ by 4 bytes of padding.
OPTIONS -e
Dump empty records. These are normally excluded.
-p
Dump with header information, similar to "ctdb catdb".
-s {0 | 32 | 64}
Specify how to determine the CTDB record header size for the input database:
0
no CTDB header
32
CTDB header size of a 32 bit system (20 bytes)
64
CTDB header size of a 64 bit system (24 bytes)
The default is 32 or 64 depending on the system architecture.
-o {0 | 32 | 64}
Specify how to determine the CTDB record header size for the output database, see -s.
-S SIZE
Explicitly specify the CTDB record header SIZE of the input database in bytes.
-O SIZE
Explicitly specify the CTDB record header SIZE for the output database in bytes.
-h
Print help text.
COMMANDS
help
Print help text.
dump IDB
Dump the contents of an LTDB input file IDB to standard output in a human-readable format.
convert IDB ODB
Copy an LTDB input file IDB to output file ODB, optionally adding or removing CTDB headers.
EXAMPLES
Print a local tdb in "tdbdump" style:
ltdbtool dump idmap2.tdb.0
Print a local tdb with header information similar to "ctdb catdb":
ltdbtool dump -p idmap2.tdb.0
Strip the CTDB headers from records:
ltdbtool convert -o0 idmap2.tdb.0 idmap.tdb
Strip 64 bit CTDB headers from records, running on i386:
ltdbtool convert -s64 -o0 idmap2.tdb.0 idmap.tdb
Strip the CTDB headers from records by piping through tdbrestore:
ltdbtool dump idmap2.tdb.0 | tdbrestore idmap.tdb
Convert a local tdb from a 64 bit system for usage on a 32 bit system:
ltdbtool convert -s64 -o32 idmap2.tdb.0 idmap2.tdb.1
Add a default header:
ltdbtool convert -s0 idmap.tdb idmap2.tdb.0
SEE ALSO ctdb(1), tdbdump(1), tdbrestore(1), ctdb(7), http://ctdb.samba.org/
AUTHOR
This documentation was written by Gregor Beck
COPYRIGHT
Copyright (C) 2011 Gregor Beck, Michael Adam
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses.
ctdb 11/27/2013 LTDBTOOL(1)