04-10-2006
find the position in a file and insert the data there
Hi,
I have a EDI data file ARROWTEST of size 18246 characters. And I want to insert some data after 4200 position in the file. How I can find the position 4200 in that file....Please advise.
Regards,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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 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
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
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
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
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
LEARN ABOUT DEBIAN
px_put_recordn
PX_PUT_RECORDN(3) Library Functions Manual PX_PUT_RECORDN(3)
NAME
PX_put_recordn -- Stores record in Paradox file at certain position
SYNOPSIS
#include <paradox.h>
int PX_put_recordn(pxdoc_t *pxdoc, char *data, int recpos)
DESCRIPTION
Stores a record in the buffer data into a Paradox file at the given position recpos. The first position has number 0. The function will
determine the data block for this record. If the position is after the last data block, then as many as needed empty data blocks will be
added. If the position is in the middle of a data block and there is no record right before the position, then the position will be recal-
culated to make sure the new record will be stored in the first free slot of the datablock. For example, if a datablock contains H records
and the first call of PX_put_recordn wants to store a record at postion 11, then this will be corrected to position H. PX_put_recordn will
also add an empty data block and store the record as the first record of the second data block. Storing a second record at position 11
again, will be executed without any position change.
data must be constructed with PX_put_data_xxx(3) functions before. It is of the same structure as the record returned by PX_get_record(3)
and PX_get_record2(3).
RETURN VALUE
Returns the record position on success and -1 on failure. The first position has number 0.
SEE ALSO
PX_get_record(3), PX_get_record2(3), PX_put_record(3), PX_put_data_byte(3), PX_put_data_short(3), PX_put_data_long(3), PX_put_data_dou-
ble(3), PX_put_data_alpha(3)
AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx.
PX_PUT_RECORDN(3)