Hi
i am having text file like this
40000201040005200213072009000000700000050744820906904421
40069300240005200713072009000000067400098543630000920442
i want to replace 9-16 positions of my txt file...by 1234567...in a single line command
i.e
0400052....should be replaced by... (2 Replies)
I am attempting to replace positions 44-46 with YYY if positions 48-50 = XXX.
awk -F "" '{if (substr($0,48,3)=="XXX") $44="YYY"}1' OFS="" $filename > $tempfile
But this is not working, 44-46 is still spaces in my tempfile instead of YYY. Any suggestions would be greatly appreciated. (9 Replies)
I have a huge file with lot of rows... with each row around 400 characters.. with spaces as well..
(e.g)
Line1:
"AC254600606 USDMI000001Anom01130073981 0000000000000.002005040720991231 ... (13 Replies)
I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space.
Total length of record is 420. Here is the specification of the data in file.
Position Field Data Type... (2 Replies)
Hi, I am trying to use an awk command to replace specific character positions on a line beginning with 80 with contents of another file.
The line beginning with 80 in file1 is as follows:
I want to replace the 000000000178800 (positions 34 - 49) on this file with the contents of... (2 Replies)
My objective is to replace the 8th, 9th, 10th characters by 1 space per character (total 3 spaces) in a file.
I achieved this using following command:
sed 's/\(.\)/\1@/7;s/@\(...\)/ /' FileData.txt > FileData_UPDATED.txt
Another situation comes when I need to done same but excluding 1st... (5 Replies)
hi. I have a requirement where I need to REPLACE all alphabets from an alphanumeric input string into their respective ASCII decimal value. For example:
If the input string is ABAC123, the output should be 65666567123
I am seeking a single line command, and I was trying searching for options... (21 Replies)
I have a test file a.txt
001 123 456 789
002 This is just a
001 test data
003 file.
I want to clear columns 5 and 6 if the first 3 characters are 001 using awk.
I tried following but does not work. Any suggestions?
awk 'BEGIN{OFS=FS=""} {if (substr($0,1,3)=="123") $5=" "; $6="... (20 Replies)
I have a fixed-length positional file. I am trying to replace content of position 4-13 (length=10) with xxxxxxxxxx.
Sample 2 rows in this file:
H0187459823 172SMITH, JOE
H0112345678 172DOE, JANE
In this example 87459823 (from 1st line) and 12345678 (from 2nd line) (both in position... (3 Replies)
Discussion started by: Diver181
3 Replies
LEARN ABOUT PHP
mb_convert_kana
MB_CONVERT_KANA(3) 1 MB_CONVERT_KANA(3)mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more)
SYNOPSIS
string mb_convert_kana (string $str, [string $option = "KV"], [string $encoding = mb_internal_encoding()])
DESCRIPTION
Performs a "han-kaku" - "zen-kaku" conversion for string$str. This function is only useful for Japanese.
PARAMETERS
o $str
- The string being converted.
o $option
- The conversion option. Specify with a combination of following options.
Applicable Conversion Options
+-------+---------------------------------------------------+
|Option | |
| | |
| | Meaning |
| | |
+-------+---------------------------------------------------+
| | |
| r | |
| | |
| | Convert "zen-kaku" alphabets to "han-kaku" |
| | |
| | |
| R | |
| | |
| | Convert "han-kaku" alphabets to "zen-kaku" |
| | |
| | |
| n | |
| | |
| | Convert "zen-kaku" numbers to "han-kaku" |
| | |
| | |
| N | |
| | |
| | Convert "han-kaku" numbers to "zen-kaku" |
| | |
| | |
| a | |
| | |
| | Convert "zen-kaku" alphabets and numbers to |
| | "han-kaku" |
| | |
| | |
| A | |
| | |
| | Convert "han-kaku" alphabets and numbers to |
| | "zen-kaku" (Characters included in "a", "A" |
| | options are U+0021 - U+007E excluding U+0022, |
| | U+0027, U+005C, U+007E) |
| | |
| | |
| s | |
| | |
| | Convert "zen-kaku" space to "han-kaku" (U+3000 |
| | -> U+0020) |
| | |
| | |
| S | |
| | |
| | Convert "han-kaku" space to "zen-kaku" (U+0020 |
| | -> U+3000) |
| | |
| | |
| k | |
| | |
| | Convert "zen-kaku kata-kana" to "han-kaku kata- |
| | kana" |
| | |
| | |
| K | |
| | |
| | Convert "han-kaku kata-kana" to "zen-kaku kata- |
| | kana" |
| | |
| | |
| h | |
| | |
| | Convert "zen-kaku hira-gana" to "han-kaku kata- |
| | kana" |
| | |
| | |
| H | |
| | |
| | Convert "han-kaku kata-kana" to "zen-kaku hira- |
| | gana" |
| | |
| | |
| c | |
| | |
| | Convert "zen-kaku kata-kana" to "zen-kaku hira- |
| | gana" |
| | |
| | |
| C | |
| | |
| | Convert "zen-kaku hira-gana" to "zen-kaku kata- |
| | kana" |
| | |
| | |
| V | |
| | |
| | Collapse voiced sound notation and convert them |
| | into a character. Use with "K","H" |
| | |
+-------+---------------------------------------------------+
o $encoding
-The $encoding parameter is the character encoding. If it is omitted, the internal character encoding value will be used.
RETURN VALUES
The converted string.
EXAMPLES
Example #1
mb_convert_kana(3) example
<?php
/* Convert all "kana" to "zen-kaku" "kata-kana" */
$str = mb_convert_kana($str, "KVC");
/* Convert "han-kaku" "kata-kana" to "zen-kaku" "kata-kana"
and "zen-kaku" alpha-numeric to "han-kaku" */
$str = mb_convert_kana($str, "KVa");
?>
PHP Documentation Group MB_CONVERT_KANA(3)