As far as i can see "sed" should be up to the task: go through your mapper file, one line at a time. There are 4 bytes in every line:
1. a "src" character
2. a ">"
3,4. a "target" character.
It is easy to divide in 2 shell variables:
Now use these variables to replace all original characters to translated ones. You have to mark you original characters somehow to make sure you don't translate characters twice during various passes. In this case we escape all characters initially with a backslash and remove these as we translate. This way we can - by searching for backslashes in the resultfile - find out if our mapper file is completely covering the input. If still backslashes are there some characters didn't get translated.
This silently presupposes the backslash "\" not to be used in your inputfile. Replace it with another (unused) character if this is not the case.
Hi guys,
I have one file with duplicate string. I want to replace all the occurance of that string with some other string.
How can I do that in vi editor?
Malay Maru (3 Replies)
i am very new to UNIX
plz help me in this scenario
i have two text files as below
file1.txt
name=Rajakumar.
Discipline=Electronics and communication.
Designation=software Engineer.
file2.txt
name=Kannan.
Discipline=Mechanical.
Designation=CADD Design Engineer.
... (6 Replies)
Hi,
Ive spent ages trying to find an explanation for how to do this on the web, but now feel like I'm :wall:
I would like to change each occurence (there are many within my script) of the following:
to
in Vim. I know how to search and replace when it is just single lines... (2 Replies)
Hi Experts,
I had to edit (a particular value) in header line of a very huge file so for that i wanted to search & replace a particular value on a file which was of 24 GB in Size. I managed to do it but it took long time to complete. Can anyone please tell me how can we do it in a optimised... (7 Replies)
Hello,
Some time ago a helpful awk file was provided on the forum which I give below:
NR==FNR{A=$0;next}{for(j in A){split(A,P,"=");for(i=1;i<=NF;i++){if($i==P){$i=P}}}}1
While it works beautifully on English and Latin characters i.e. within the ASCII range of 127, the moment a character beyond... (6 Replies)
Hello,
I looked for all search and replace routines in the forum but could find none which meets my requirement.
I have a file in which a set of mappers are provided. The structure is as under
a=b
c=d
e=f
A simplistic example from English and French would make this clear:
John=Jean... (2 Replies)
Hi Team,
I am new to unix, please help me in this.
I have a file named properties.
The content of the file is :
##Mobile props
east.url=https://qa.east.corp.com/prop/end
west.url=https://qa.west.corp.com/prop/end
south.url=https://qa.south.corp.com/prop/end... (2 Replies)
Hi,
more data.txt
more srstring.sh
input="data.txt"
while IFS= read -r var
do
startdirectory=$loc
search=$(echo $var | awk -F'=' '{print $1}')
replace=$(echo $var | awk -F'=' '{print $2}')
find "/tmp/config" -type f -exec grep -l "$search" {} + |
while read file
do if sed -e... (9 Replies)
i have a real data prod file with 80+ fields containing 1k -2k records. i have to extract say 12 columns out of this which are sensitive fields along with one primary key say SEQ_ID (like DOB,account no, name, SEQ_ID, govtid etc) in a lookup file. i have to replace these sensitive fields in... (11 Replies)
Discussion started by: megh12
11 Replies
LEARN ABOUT CENTOS
thin_dump
THIN_DUMP(8) System Manager's Manual THIN_DUMP(8)NAME
thin_dump - dump thin provisioning metadata from device or file to standard output
SYNOPSIS
thin_dump [options] {device|file}
DESCRIPTION
thin_dump dumps binary thin provisioning metadata (optionally from alternate block; see option --metadata-snap) created by the device-map-
per thin provisioning target on a device or file to standard output for analysis or postprocessing in either XML or human readable format.
XML formated metadata can be fed into thin_restore (see thin_restore(8)) in order to put it back onto a metadata device (to process by the
device-mapper target) or file.
-f, --format {xml|human_readable}
Print output in XML or human readable format.
-r, --repair
Repair the metadata whilst dumping it.
-m, --metadata_snap [block#]
Dump metadata snapshot created by device-mapper thin provisioning target. If block is not provided, access the default metadata snapshot
created by the thin provisioning device-mapper target, else try the one at block#. See the thin provisioning target documentation on how
to create or release a metadata snapshot and retrieve the block number from the kernel.
-h, --help
Print help and exit.
-V, --version
Output version information and exit.
EXAMPLES
Dumps the thin provisioning metadata on logical volume /dev/vg/metadata to standard output in human readable format:
thin_dump -f human_redable /dev/vg/metadata
Dumps the thin provisioning metadata on logical volume /dev/vg/metadata to standard output in XML format:
thin_dump /dev/vg/metadata
Dumps the thin provisioning metadata snapshot on logical volume /dev/vg/metadata to standard output in human readable format (not process-
able by thin_restore(8) ):
thin_dump --format human_readable --metadata-snap /dev/vg/metadata
DIAGNOSTICS
thin_dump returns an exit code of 0 for success or 1 for error.
SEE ALSO thin_check(8)thin_repair(8)thin_restore(8)thin_rmap(8)thin_metadata_size(8)AUTHOR
Joe Thornber <ejt@redhat.com>
Heinz Mauelshagen <HeinzM@RedHat.com>
Red Hat, Inc. Thin Provisioning Tools THIN_DUMP(8)