Process the record only for defined length


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Process the record only for defined length
# 1  
Old 04-02-2014
Process the record only for defined length

I have two files. One file have length defined and other file have data.

I need to do some processing in data file only for the length mentioned in the length file.

my lenth file has one record with five bytes, need to store the last two bytes as length.

for example, if my file has a record like,
000040

Then 40 is my lenth. I need to process my data file for 40 position.

Last edited by srvn_saru; 04-02-2014 at 11:22 AM.. Reason: given bytes instead of position
# 2  
Old 04-02-2014
?
Do you mean the record is of 40 bytes for the (entire) file?
# 3  
Old 04-02-2014
For example gave 40.
# 4  
Old 04-02-2014
Yes that you said already but what is it? the size of record for that file?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies

2. Shell Programming and Scripting

Verifying Record Length

Hi all, We are going through a total migration from AIX-based server framework to Linux-based servers. When I am testing *.sh and *.awk in a lower environments, it abends at the same step everytime in verifying the record length of the first row of the source file. I know this source file... (11 Replies)
Discussion started by: SoloXX
11 Replies

3. Shell Programming and Scripting

Record length

Hi, The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command. Thanks in Advance (6 Replies)
Discussion started by: NareshN
6 Replies

4. Shell Programming and Scripting

Viewing a record of particular length

I have records with different lengths say 386, 387 and 388. Do i have any command to view all the records of the length 386 ? Please do advise. Thanks (2 Replies)
Discussion started by: bobby1015
2 Replies

5. Shell Programming and Scripting

sort file specifying record length

I've been searching high and low for this...but, maybe I'm just missing something. I have a file to be sorted that, unfortunately, contains binary data at the end of the line. As you may guess, this binary data may contain a newline character, which messes up the sort. I think I could resolve this... (5 Replies)
Discussion started by: jcagle
5 Replies

6. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

7. Shell Programming and Scripting

Check length of record

Hi, I have a problem, please help me, I have a flat file like this: P00000000088888888999999999 0000999903 000000000000000000 P00000000077777777000000000 0000999903 000000000000000000 P00000000044444444333333333 0000999903 00000000000000000079875 P00000000066666666111111111 0000999903 ... (5 Replies)
Discussion started by: DebianJ
5 Replies

8. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

9. Shell Programming and Scripting

fixed record length

hello! I have a file with fixed record length... format: 123445asdfg 4343777 sfgg I wanna convert it to 123445,asdfg ,4343,777 ,sfgg is there any way to do it? sed/grep/awk?? at the moment I use sed -e 's_ \(\)_,\1_g' but it works only if there are spaces between... (16 Replies)
Discussion started by: george_
16 Replies
Login or Register to Ask a Question