Sponsored Content
Top Forums Shell Programming and Scripting how to fix the column length in a file using Awk Prog Post 302354045 by meva on Thursday 17th of September 2009 01:02:06 AM
Old 09-17-2009
Thanks...Going forward i ll make sure that i dont miss the above rules.

Meva.
 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

print a file with one column having fixed character length

Hi guys, I have tried to find a solution for this problem but couln't. If anyone of you have an Idea do help me. INPUT_FILE with three columns shown to be separated by - sign A5BNK723NVI - 1 - 294 A7QZM0VIT - 251 - 537 A7NU3411V - 245 - 527 I want an output file in which First column... (2 Replies)
Discussion started by: smriti_shridhar
2 Replies

3. Shell Programming and Scripting

AWK record length fix

Hi Friends, Need some help in AWK. Working on AIX 5 Have been trying the following functionality to make the record length fixed: if( length(record) < 300 ) { printf("%-300s\n", record); } In my opinion it will apply some fillers in the end. Its is not making any... (4 Replies)
Discussion started by: kanu_pathak
4 Replies

4. Shell Programming and Scripting

how to validate a field when it is blank using awk prog

Hi, I tried the below piece of code for my script to check whether it has a blank space for a particular field. if(f10==/]/){ print "Field 10 is Correct";} else{ print "Field 10 is Wrong"; } Please help me to know whether the "if" condition applied here is correct or do i... (14 Replies)
Discussion started by: meva
14 Replies

5. Shell Programming and Scripting

Finding multiple column values and match in a fixed length file

Hi, I have a fixed length file where I need to verify the values of 3 different fields, where each field will have a different value. How can I do that in a single step. (6 Replies)
Discussion started by: naveen_sangam
6 Replies

6. Shell Programming and Scripting

Fix CSV file with column missing quotes

I have a CSV file that is missing quotes around a column that contains text with commas. Example: Column1, Column2, Column3, Column4, Column5, Column6 Data1, Data2, Data3, Data, 4, Data5, Data6 Data1, Data3, Data3, Data, text, 4, Data5, Data6 I think the easiest way for me to fix this is to... (2 Replies)
Discussion started by: EmptyH
2 Replies

7. Shell Programming and Scripting

Need to extract data from Column having variable length column

Hi , I need to extract data from below mentioned data, having no delimiter and havin no fixed column length. For example: Member nbr Ref no date 10000 1000 10202012 200000 2000 11202012 Output: to update DB with memeber nbr on basis of ref no. ... (6 Replies)
Discussion started by: ns64110
6 Replies

8. Shell Programming and Scripting

file column length using awk

1|BANG|KINR|3456 2|BANG2222|KINR|347 3|BANG|KINR|347 4|BANG|KINR|347 5|BANG|KINR|347 6|BANG|KINR|347 awk -F"|" ' length($2)>=4||length($4)>=4 {print $0 >"above.txt";next}' test1.txt i want required output,because if the 2nd column more than 4 character or 4th column more than 4... (5 Replies)
Discussion started by: bmk
5 Replies

9. Shell Programming and Scripting

Convert comma separated file to fix length

Hi, I am converting a comma separated file to fixed field lenght and I am using that: COLUMNS="25 24 67 26 39 63 20 34 35 14 397" ( cat $indir/input_file.dat | \ $AWK -v columns="$COLUMNS" ' BEGIN { FS=","; OFS=""; split(columns, arr, " "); } { for(i=1; i<=NF;... (5 Replies)
Discussion started by: apenkov
5 Replies

10. UNIX for Dummies Questions & Answers

awk file subtracted by a fix value - conditioned

Hi all... i have been trying to make this work but I have been failing for 6 hours .. I know it should be something simple that I am missing to it would be great if you can help me ... I want to subtract a fixed value (lets set 1) from any value >=1 from the whole file my file looks like ... (4 Replies)
Discussion started by: A-V
4 Replies
forward(4)						     Kernel Interfaces Manual							forward(4)

NAME
forward - forward mail SYNOPSIS
/var/adm/forward/username $HOME/.forward DESCRIPTION
The .forward file allows a user to forward messages to another host, or to invoke programs (such as vacation(1)) to process their mail. It is formatted as a series of comma-separated addresses in the form: addr_1, addr_2, ... Alternatively, each address can be on a separate line. The newer sendmail.v8 program also allows the use of comments (lines that begin with a ``#'') and blank lines. As with the aliases(4) file, mail messages can be forwarded to another host or given to programs for further processing. The following is an example of the vacation program. Assuming that the user's name is myra, create a .forward file and add the following line: myra, "|/usr/bin/vacation myra" The previous example forwards mail to myra (the backslash prevents an accidental aliasing loop), and also sends a copy of the message to the vacation program. For security reasons, the file must be owned by the user or by root and it should be writable only by the file owner. In addition, the file must be readable by the owner (myra) or root. On traditional systems, only the $HOME/.forward file is checked. The sendmail.v8 program allows the use of the system-wide forwarding directory /var/adm/forward. By default, this directory is checked for a forward file prior to examining the users $HOME directory. FILES
System-wide forwarding file. The per-user forwarding file. RESTRICTIONS
The sendmail command can hang trying to read the user's $HOME/.forward file. If the user's home directory is NFS-mounted and temporarily unavailable, sendmail will stall until the directory becomes available again. The use of non-NFS mounted directories for the forwarding of files is recommended. The use of /var/adm/forward is supported only by sendmail.v8. The actual path for /var/adm/forward is configurable in the sendmail.cf file. Incorrect file permissions/ownership are quietly ignored. It is easy to create an accidental loop, for example, on host_a myra@host_b and on host_b myra@host_a RELATED INFORMATION
Commands: aliases(4), sendmail.cf(4), sendmail(8) delim off forward(4)
All times are GMT -4. The time now is 11:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy