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)
Hi,
I would like to know how can I get all the positions of a letter, let say letter C in a text file.
sample input file:
hcck
pgog
hlhhc
desired output file:
2
3
13
Many thanks! (2 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)
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)
Hi all, I have column 2 full of values like HIVE4A-56 and HIVE4-56. I want to convert all values like HIVE4A-56 to HIVE4-56.
So basically I want to delete all single alphabets before the '-' which is always preceded by a number. Values already in the desired format should remain unchanged... (4 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 Team -
I hope everyone has been well!
I export a file from one of our source systems that gives me more information than I need. The way the file outputs, I need to extract certain strings at different positions on the file and echo them to another file.
I can do this in batch easily,... (2 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 ULTRIX
dwtstextreplace
DwtSTextReplace(3Dwt)DwtSTextReplace(3Dwt)Name
DwtSTextReplace - Replaces a portion of the current text string in the simple text widget or inserts a new substring in the text.
Syntax
void DwtSTextReplace(widget, from_pos, to_pos, value)
Widget widget;
int from_pos, to_pos;
DwtCompString value;
Arguments
widget Specifies the ID of the simple text widget whose text string you want to replace.
from_pos Specifies the beginning character position within the text string marking the text being replaced.
to_pos Specifies the last character position within the text string marking the text being replaced.
value Specifies the text to replace part of the current text in the simple text widget.
Description
The DwtSTextReplace function replaces part of the text string in the simple text widget. Within the window, the positions are numbered
starting from 0 and increasing sequentially. For example, to replace the second and third characters in the string, from_pos should be 1
and to_pos should be 3. To insert a string after the fourth character, from_pos and to_pos should both be 4.
See AlsoDwtSText(3Dwt), DwtSTextGetString(3Dwt), DwtSTextGetEditable(3Dwt), DwtSTextSetEditable(3Dwt), DwtSTextGetMaxLength(3Dwt), DwtS-
TextSetMaxLength(3Dwt), DwtSTextSetSelection(3Dwt), DwtSTextClearSelection(3Dwt), DwtSTextGetSelection(3Dwt)
Guide to the XUI Toolkit: C Language Binding
Guide to the XUI Toolkit Intrinsics: C Language Binding
DwtSTextReplace(3Dwt)