Sponsored Content
Top Forums UNIX for Advanced & Expert Users how to find lenght of fixed width file record? Post 302710771 by Seshendranath on Friday 5th of October 2012 01:21:56 AM
Old 10-05-2012
actually wht ever command which i gave is working in intractive mode but when i run d program it removing spaces in record and returning d record count d same while writing in to file.
thaxz fr reply in advance.

---------- Post updated at 10:51 AM ---------- Previous update was at 08:55 AM ----------

can any give me code fr d below
Actually i am reading a record from teradata db table i.e, fixed width with spaces in between, now i want to find good record from tht file according to record length if length is more than the fixed width file length then it will remove tht error record to new file from base file. we will give file as parameter. Plzs help out in this
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Fixed Width file using AWK

I am using the following command at the Unix prompt to make my 'infile' into a fixed width file of 100 characters. awk '{printf "%-100s\n",$0}' infile > outfile However, there are some records with a special character "©" These records are using 3 characters in place of one and my record... (2 Replies)
Discussion started by: alok.benjwal
2 Replies

2. Shell Programming and Scripting

How to insert a record in fixed width flatfile

I have a fixed width flatfile with 5 columns, i will load file from oracle database to the flatfile for every 15 min at the end of the file, i want to insert a record by calling a shell script for inserting a record. please can any one help me. Thanks. (1 Reply)
Discussion started by: limou
1 Replies

3. Shell Programming and Scripting

Can we convert a '|' file into a fixed lenght???

Hi All, I have a pipe separated flat file.But there is often some problem with the records.So is it possible to convert the '|' separated file into a fixed length file by means of some script. The file has 11 columns which means 10 pipes.Your help is appreciated. i'm using Sun OS Version... (2 Replies)
Discussion started by: kumarsaravana_s
2 Replies

4. UNIX Desktop Questions & Answers

Help with Fixed width File Parsing

I am trying to parse a Fixed width file with data as below. I am trying to assign column values from each record to variables. When I parse the data, the spaces in all coumns are dropped. I would like to retain the spaces as part of the dat stored in the variables. Any help is appreciated. I... (4 Replies)
Discussion started by: sate911
4 Replies

5. 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

6. Shell Programming and Scripting

Removing \n within a fixed width record

I am trying to remove a line feed (\n) within a fixed width record. I tried the tr -d ‘\n' command, but it also removes the record delimiter. Is there a way to remove the line feed without removing the record delimiter? (10 Replies)
Discussion started by: CKT_newbie88
10 Replies

7. Shell Programming and Scripting

Fixed-Width file from Oracle

Hi All, I have created a script which generates FIXED-WIDTH file by executing Oracle query. SELECT RPAD(NVL(col1,CHR(9)),20)||NVL(col2,CHR(9))||NVL(col3,CHR(9) FROM XYZ It generates the data file with proper alignment. But if same file i transfer to windows server or Mainframe... (5 Replies)
Discussion started by: Amit.Sagpariya
5 Replies

8. Shell Programming and Scripting

Comparing two fixed width file

Hi Guys I am checking the treads to get the answer but i am not able to get the answer for my question. I have two files. First file is a pattern file and the second file is the file i want to search in it. Output will be the lines from file2. File1: P2797f12af 44751228... (10 Replies)
Discussion started by: anshul_er
10 Replies

9. UNIX for Dummies Questions & Answers

Length of a fixed width file

I have a fixed width file of length 53. when is try to get the lengh of the record of that file i get 2 different answers. awk '{print length;exit}' <File_name> The above code gives me length 50. wc -L <File_name> The above code gives me length 53. Please clarify on... (2 Replies)
Discussion started by: Amrutha24
2 Replies

10. Shell Programming and Scripting

Alter Fixed Width File

Thank u so much .Its working fine as expected. ---------- Post updated at 03:41 PM ---------- Previous update was at 01:46 PM ---------- I need one more help. I have another file(fixed length) that will get negative value (ex:-00000000003000) in postion (98 - 112) then i have to... (6 Replies)
Discussion started by: vinus
6 Replies
g3cat(1)						       mgetty+sendfax manual							  g3cat(1)

NAME
g3cat - concatenate multiple g3 documents SYNOPSIS
g3cat [-l] [-a] g3-file1 ... DESCRIPTION
g3cat concatenates g3 files. These can either be 'raw', that is, bitmaps packed according to the CCITT T.4 standard for one-dimensional bitmap encoding, or 'digifax' files, created by GNU's GhostScript package with the digifax drivers. Its output is a concatenation of all the input files, in raw G3 format, with two white lines in between. If a - is given as input file, stdin is used. If the input data is malformed, a warning is printed to stderr, and the output file will have a blank line at this place. OPTIONS
-l separate files with a one-pixel wide black line. -h <blank lines> specifies the number of blank lines g3cat should prepend to each page. Default is 0. -L <lines> limit lenght of output page to maximum <lines> lines. SPECIAL-CASE OPTIONS -w <width> specifies the desired page width in pixels per line. Default is 1728 PELs, and this is mandatory if you want to send the fax to a standard fax machine. If one of the input files doesn't match this line width (for example because it was created by a broken G3 creator), a warning is printed, and the line width is transparently fixed. -a byte-align the end-of-line codes (EOL) in the file. Every EOL will end at a byte boundary, that is, with a 01 byte. -p <pad> specifies a minimum number of bytes that each output line must be padded to. Padding is done with 0-bits before the EOL code. -R suppress output of end-of-page code (RTC). Example The following example will put a header line on a given g3 page, 'page1' and put the result into 'page2': echo '$header' | pbmtext | pbm2g3 | g3cat - page1 >page2 FILES
-- BUGS
Hopefully none :-). SEE ALSO
g32pbm(1), sendfax(8), faxspool(1) AUTHORS
g3cat is Copyright (C) 1993 by Gert Doering, <gert@greenie.muc.de> greenie 27 Oct 93 g3cat(1)
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy