Sponsored Content
Top Forums Shell Programming and Scripting Delete character on specific position Post 302916066 by Don Cragun on Saturday 6th of September 2014 01:53:15 PM
Old 09-06-2014
Although both sed and cut work on Ubuntu, the standards only require sed to work on text files. Files with lines containing more than 2048 bytes are not text files on HP-UX. The cut utility, however, is required to work on files with arbitrary line lengths; so it should work on any system.

As RudiC said for sed, the number of lines being processed doesn't matter; both cut and sed work on one line at a time; they don't need to read the whole file into memory at once to do this job.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to add character in specific position of a string?

Hi All, I would like to use sed to add "-" between the following string: Value: 20060830 Result: 2006-08-30 Pls advice. Thx a lot Victor (5 Replies)
Discussion started by: victorlung
5 Replies

2. Shell Programming and Scripting

Print lines with specific character at nth position in a file

I need to print lines with character S at nth position in a file...can someone pl help me with appropriate awk command for this (2 Replies)
Discussion started by: manaswinig
2 Replies

3. Shell Programming and Scripting

Print lines with specific character at nth position in a file

I need to print lines with character S at nth position in a file...can someone pl help me with appropriate awk command for this (1 Reply)
Discussion started by: manaswinig
1 Replies

4. Shell Programming and Scripting

Insert character in a specific position of a file

Hi, I need to add Pipe (|) at 5th and 18th position of all records a file. How can I do this? I tried to add it at 5th position using the below code. It didnt work. Please help!!! awk '{substr($0,5,1) ~ /|/}{print}' $input_file > $temp_file (1 Reply)
Discussion started by: gpaulose
1 Replies

5. Shell Programming and Scripting

Using sed to replace specific character and specific position

I am trying to use sed to replace specific characters at a specific position in the file with a different value... can this be done? Example: File: A0199999123 A0199999124 A0199999125 Need to replace 99999 in positions 3-7 with 88888. Any help is appreciated. (5 Replies)
Discussion started by: programmer22
5 Replies

6. Shell Programming and Scripting

Delete character in determinate position with sed/awk

Hello. I'm trying to delete one character in determinate position. Example: qwEtsdf123Ecv34 <delete character in positión 3> Result: qwtsdf123Ecv34 Plase, help me. Thanks (4 Replies)
Discussion started by: maria_florencia
4 Replies

7. Linux

Removing a character at specific position in a column

Hi, I have a file like this (about 8 columns in total, this being the 2nd column) gi_49482297_ref_YP_039521.1_ gi_49482297_ref_YP_039521.1_ gi_49482315_ref_YP_039539.1_ gi_49482315_ref_YP_039539.1_I want to remove the _ at the end of the line. And at later stages I would want to replace the... (5 Replies)
Discussion started by: Syeda Sumayya
5 Replies

8. UNIX for Beginners Questions & Answers

Delete columns with a specific title XXX, where the position change in each file

Goodmorning, I know how to cut a string and a column, and how to find a word. I have a file with over 100 columns. All columns have a title in the first line. I have to delete all columns with the XXX title. I can't use cut -f because the position of XXX columns change in each file, and in... (14 Replies)
Discussion started by: echo manolis
14 Replies

9. Post Here to Contact Site Administrators and Moderators

Search for a pattern and replace a space at specific position with a Character in File

In file, we have millions of records each of 1000 in length. And at specific position say 800 there is a space, we need to replace it with Character X if the ID in that row starts with 123. So far i have used the below which is replacing space at that position to X but its not checking for... (3 Replies)
Discussion started by: Jagmeet Singh
3 Replies

10. Shell Programming and Scripting

Count specific character of a file in each line and delete this character in a specific position

I will appreciate if you help me here in this script in Solaris Enviroment. Scenario: i have 2 files : 1) /tmp/TRANSACTIONS_DAILY_20180730.txt: 201807300000000004 201807300000000005 201807300000000006 201807300000000007 201807300000000008 2)... (10 Replies)
Discussion started by: teokon90
10 Replies
DtEditorGetLastPosition(library call)									     DtEditorGetLastPosition(library call)

NAME
DtEditorGetLastPosition -- retrieve the position of the last character in a DtEditor widget SYNOPSIS
#include <Dt/Editor.h> XmTextPosition DtEditorGetLastPosition( Widget widget); DESCRIPTION
The DtEditorGetLastPosition function accesses the last text position in the DtEditor widget. The position is an integer number of charac- ters from the beginning of the widget's buffer. Any text added to the end of the buffer is added after this position. The first character position is zero. The last character position is equal to the number of characters contained in the widget. The widget argument specifies the DtEditor widget ID. For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3). RETURN VALUE
Upon successful completion, the DtEditorGetLastPosition function returns an XmTextPosition value that indicates the last position in the text; otherwise, it returns NULL. APPLICATION USAGE
The position information is given in terms of characters, which may differ from the byte position when multi-byte code sets are in use. SEE ALSO
Dt/Editor.h - DtEditor(5), DtEditor(3), DtEditorGetInsertionPosition(3), DtEditorSetInsertionPosition(3). DtEditorGetLastPosition(library call)
All times are GMT -4. The time now is 03:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy