Sponsored Content
Operating Systems HP-UX find the position in a file and insert the data there Post 302070965 by Ygor on Monday 10th of April 2006 09:16:24 PM
Old 04-10-2006
Try using split -b, e.g...
Code:
split -b 4200 infile  tmpfile.
for file in tmpfile.??
do
    cat $file
    if [[ $file = tmpfile.aa ]]
    then
       printf "additional data goes here"
    fi
done > outfile
rm tmpfile.??

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert at a particular position in flat file

Hi All, I have a flat file with ~ as de-limiter (e.g: aaa~ba a~caa~0~d~e) What I want is check if the 4th character is 0 and replace it with say 4. So now it becomes : aaa~ba a~caa~4~d~e. I have to do this for the whole file, but the delimiter position remains the same, not the... (10 Replies)
Discussion started by: akdwivedi
10 Replies

2. Shell Programming and Scripting

how to find a position and print some string in the next and same position

I need a script for... how to find a position of column data and print some string in the next line and same position position should find based on *HEADER8* in text for ex: ord123 abs 123 987HEADER89 test234 ord124 abc 124 987HEADER88 test235 ... (1 Reply)
Discussion started by: naveenkcl
1 Replies

3. UNIX for Dummies Questions & Answers

find if a position is between a given start and end position

Hi, I am a newbie in unix programming so maybe this is a simple question. I would like to know how can I make a script that outputs only the values that are not between any given start and end positions Example file1: 2 30 40 80 82 100 file2: ID1 1 ID2 35 ID3 80 ID4 81 ID6... (9 Replies)
Discussion started by: fadista
9 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

Insert file contents into another file at a given position

I'm trying to write a small shell script/command to insert the contents of one file into another file at a position marked with a given text string. It's not necessarily at the top or bottom of the file so I can't just use cat to cat the files together. I think probably sed with the r option is... (5 Replies)
Discussion started by: shaun29
5 Replies

6. Shell Programming and Scripting

How to find character position in file?

how to find character positionin file? i.e string = "123X568" i want to find the position of character "X". Thanks (6 Replies)
Discussion started by: LiorAmitai
6 Replies

7. Shell Programming and Scripting

Find the starting position in a file

I have a file called "INPUT" which takes the following format MNT-BANK-NUMBERO:006,00:N MNT-100-ACCOUNT-NUMBERO:018,00:N MNT-1000-DESCRIPTIONO:045:C . . . Now i got to find the displacements of the account numbers of each field of a file. For the field MNT-BANK-NUMBERO:006,00:N, the... (4 Replies)
Discussion started by: bobby1015
4 Replies

8. UNIX for Dummies Questions & Answers

Need to copy data from one position to another in file

Hi. I need to write a script that will allow me to copy data from one position in a line to another position while changing the first 2 bytes of the data to a constant. Here is an example of a line of data before and what it needs to look like after. there are about 200 lines in the file. ... (1 Reply)
Discussion started by: wlb_shore_user
1 Replies

9. Shell Programming and Scripting

Add '|' to data file on particular position

I have below scenario where i am getting a flat file but with some bad data incoming data format id|name|ind|crncy 123|xxx|y|usd 234|yy|n| 456|a|y90.5|vvv|gbp ----bad dataneed to cleanse the bad data above by adding a pipe '|' after 3rd column 'ind' if pipe '|' is not already there ... (1 Reply)
Discussion started by: rakesh5300
1 Replies

10. Shell Programming and Scripting

Column to row and position data in a text file

Hi everyone.. I have a list of values in a file... a, b, c, 1, 2, 3, aaaa, bbbbb, I am interested in converting this column to a row.. "text",aaaa, bbbb a,1 (7 Replies)
Discussion started by: manihi
7 Replies
DtEditorGetInsertionPosition(library call)								DtEditorGetInsertionPosition(library call)

NAME
DtEditorGetInsertionPosition -- retrieve the position of the insert cursor in a DtEditor widget SYNOPSIS
#include <Dt/Editor.h> XmTextPosition DtEditorGetInsertionPosition( Widget widget); DESCRIPTION
The DtEditorGetInsertionPosition function accesses the current position of the insertion cursor in the DtEditor widget. The position is an integer number of characters from the beginning of the widget's text buffer. The first character position is zero. The position of the insertion cursor can be set with DtEditorSetInsertionPosition(3). 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 DtEditorGetInsertionPosition function returns an XmTextPosition value that indicates the position of the insertion cursor in the text; otherwise, it returns NULL. SEE ALSO
Dt/Editor.h - DtEditor(5), DtEditor(3), DtEditorGetLastPosition(3), DtEditorSetInsertionPosition(3). DtEditorGetInsertionPosition(library call)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy