Sponsored Content
Top Forums Shell Programming and Scripting Combining Two fixed width columns to a variable length file Post 302208555 by manneni prakash on Tuesday 24th of June 2008 07:47:26 AM
Old 06-24-2008
Combining Two fixed width columns to a variable length file

Hi, I have two files.

File1:

File1 contains two fixed width columns ID of 15 characters length and Name is of 100 characters length.

ID Name
1-43<<11 spaces>>Swapna<<94 spaces>>
1-234<<10 spaces>>Mani<<96 spaces>>
1-3456<<9 spaces>>Kapil<<95 spaces>>

File2:

File2 contains two fixed width columns ID of 15 characters length and Name is of 80 characters length.

ID Place
1-3456<<10 spaces>>Boston<<74 spaces>>
1-43<<11 spaces>>London<<74spaces>>

I need an output file of variable length file as follows

Output:

The Output file should contain the matched records of both File1 and File2 based on ID column.

Id Name
1-43<<1 space>>Swapna
1-234
1-3456<<1 space>>Kapil

Thanks in Advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a fixed length output from a variable length input

Is there a command that sets a variable length? I have a input of a variable length field but my output for that field needs to be set to 32 char. Is there such a command? I am on a sun box running ksh Thanks (2 Replies)
Discussion started by: r1500
2 Replies

2. Shell Programming and Scripting

Comparing column of variable length anf fixed width file

Hi, I have two input files. File1: ID Name Place 1-234~name1~Newyork 1-34~name2~Boston 1-2345~name3~Hungary File1 is a variable length file where each column is seperated by delimitter "~". File2: ID Country 1-34<<11 SPACES>>USA<<7 spaces>> 1-234<<10 SPACES>>UK<<8... (5 Replies)
Discussion started by: manneni prakash
5 Replies

3. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

4. Shell Programming and Scripting

Printing Fixed Width Columns

Hi everyone, I have been working on a pretty laborious shellscript (with bash) the last couple weeks that parses my firewall policies (from a Juniper) for me and creates a nifty little columned output. It does so using awk on a line by line basis to pull out the appropriate pieces of each... (4 Replies)
Discussion started by: cixelsyd
4 Replies

5. Shell Programming and Scripting

changing a variable length text to a fixed length

Hi, Can anyone help with a effective solution ? I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces. The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies

6. Shell Programming and Scripting

How to parse fixed-width columns which may include empty fields?

I am trying to selectively display several columns from a db2 query, which gives me a fixed-width output (partial output listed here): --------- -------------------------- ------------ ------ 000 0000000000198012 702 29 000 0000000000198013 ... (9 Replies)
Discussion started by: ahsh79
9 Replies

7. Shell Programming and Scripting

Removing duplicates in fixed width file which has multiple key columns

Hi All , I have a requirement where I need to remove duplicates from a fixed width file which has multiple key columns .Also , need to capture the duplicate records into another file . File has 8 columns. Key columns are col1 and col2. Col1 has the length of 8 col 2 has the length of 3. ... (5 Replies)
Discussion started by: saj
5 Replies

8. UNIX for Dummies Questions & Answers

Fixed length file extracting values in columns

How do I extract values in a few columns in a row of a fixed length file? If there are 8 columns and I need to extract values of 2nd,4th and 6 th columns, how do i do that? I used cut command, this I used only for one column. How do I do it more than one column? The below command will give... (1 Reply)
Discussion started by: princetd001
1 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

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
dl510kaof(8)						      System Manager's Manual						      dl510kaof(8)

NAME
dl510kaof - Filter for the Korean DL510-KA printer SYNOPSIS
/usr/lbin/dl510kaof [-c] [-h host] [-i indent] [-l length] [-L locale] [-n login] [-w width] [accounting_file] OPTIONS
Prints control characters. Specifies the host name of the job owner. This name can contain Korean characters. Specifies the amount of indentation. The default value is no (no indentation). Specifies the page length in lines. The default value is 66. Specifies the printer codeset. This value, by default ko_KR.deckorean, must be a valid locale name. Specifies the login name of the job owner. This name can contain Korean characters. Specifies the page width in columns. The default value is 132. OPERANDS
Specifies the file to record accounting information. DESCRIPTION
The dl510kaof filter is used to filter text data sent to the DL510-KA printer. The filter handles the device dependencies of the printer and performs accounting functions. At completion of each print job, accounting records are written to the file specified for the af field in the /etc/printcap file. The dl510kaof filter can handle ASCII text files, Korean text files, and files that have been preprocessed by nroff. The dl510kaof filter translates nroff control sequences for underlining, superscripting and subscripting into the proper DL510-KA control sequences. The dl510kaof filter can be the specified filter in both the of and the if fields in the /etc/printcap file. For further information on these fields, see printcap(4). ERRORS
The lf field (default value /dev/null) in the /etc/printcap file specifies the name of the error logging file. SEE ALSO
Commands: lpd(8), lpr(1), pac(8), pr(1) Files: printcap(4) Others: i18n_printing(5) dl510kaof(8)
All times are GMT -4. The time now is 01:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy