Sponsored Content
Top Forums Shell Programming and Scripting arrays and needing length of fields Post 302198181 by aju_kup on Thursday 22nd of May 2008 09:42:31 AM
Old 05-22-2008
use printf
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

fixed length fields in awk

I am trying to display df -h command out in proper format, how can I display each field of each record in a fixed length. (2 Replies)
Discussion started by: roopla
2 Replies

2. Shell Programming and Scripting

Compare two arrays in sh or compare two fields

I want a soultion to compare two arrays in sh with an easy way.I want a solution to synchrose users between different AIX servers where no NIS is available. All users are meant to be same on all 10 servers. So the approach is to consider first server as master user repository and whatever the users... (0 Replies)
Discussion started by: rijeshpp
0 Replies

3. Shell Programming and Scripting

Need awk script to compare 2 fields in fixed length file.

Need a script that manipulates a fixed length file that will compare 2 fields in that file and if they are equal write that line to a new file. i.e. If fields 87-93 = fields 119-125, then write the entire line to a new file. Do this for every line in the file. After we get only the fields... (1 Reply)
Discussion started by: Muga801
1 Replies

4. UNIX for Dummies Questions & Answers

File Field Replacement, Assigning Fields to Variables, Lists/Arrays?

Okay, I've made threads on extracting fields and comparing strings in separate files in .csv's. I've written the following code with intentions of learning more. I just want this one question answered: How can I assign fields from a file(comma separated) to variables? My goal is to check... (0 Replies)
Discussion started by: chickeneaterguy
0 Replies

5. Programming

question about int arrays and file pointer arrays

if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Discussion started by: omega666
1 Replies

6. Shell Programming and Scripting

Fixed length fields

HPUX and posix shell Hi all. I have a record with fixed length fields....I would like to reorder the fields and preserver the fixed lengths.... cat test 4 960025460 Dept of Music 8 960025248 Dept of Music 12-08 cat... (3 Replies)
Discussion started by: lyoncc
3 Replies

7. UNIX for Dummies Questions & Answers

Using the Foreach loop, Needing help

I am trying to make a script for my Counter-Strike: Source servers. What i am wanting it to do is for it to restart each server, the only way i can think of doing this in through for each. Years what i have at the moment. server_start() { START=`ps x | grep SCREEN | grep $SRV | cut -d '?' -f... (5 Replies)
Discussion started by: grahamn95
5 Replies

8. Shell Programming and Scripting

Flat file-make field length equal to header length

Hello Everyone, I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table. Input Data- ------ ------------------------ ---- ----------------- WFI001 Xxxxxx Control Work Item A Number of Records ------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies

9. Shell Programming and Scripting

File splitting according to the length of the fields

Hi All, I have two files: 1> Data file 2> info file which has field lengths and start position. Is there a way to create a comma delimited file according to the fields length and start position. Data file : R-0000017611N-00000350001095ANZU01 A00000017611N000000350001095ANZU02... (11 Replies)
Discussion started by: nua7
11 Replies

10. UNIX for Beginners Questions & Answers

Splitting the file based on two fields - Fixed length file

Hi , I am having a scenario where I need to split the file based on two field values. The file is a fixed length file. ex: AA0998703000000000000190510095350019500010005101980301 K 0998703000000000000190510095351019500020005101480 ... (4 Replies)
Discussion started by: saj
4 Replies
AP(8)								     [nmh-1.5]								     AP(8)

NAME
ap - parse addresses 822-style SYNOPSIS
/usr/lib/mh/ap [-form formatfile] [-format string] [-normalize | -nonormalize] [-width columns] [-version] [-help] addrs ... DESCRIPTION
Ap is a program that parses addresses according to the ARPA Internet standard. It also understands many non-standard formats. It is use- ful for seeing how nmh will interpret an address. The ap program treats each argument as one or more addresses, and prints those addresses out in the official 822-format. Hence, it is usu- ally best to enclose each argument in quotes for the shell. To override the output format used by ap, the -format string or -format file switches are used. This permits individual fields of the address to be extracted with ease. The string is simply a format string, and the file is simply a format file. See mh-format(5) for the details. In addition to the standard escapes, ap also recognizes the following additional escape: Escape Returns Description error string A diagnostic if the parse failed If the -normalize switch is given, ap will try to track down the official hostname of the address. Here is the default format string used by ap: %<{error}%{error}: %{text}%|%(putstr(proper{text}))%> which says that if an error was detected, print the error, a `:', and the address in error. Otherwise, output the 822-proper format of the address. FILES
$HOME/.mh_profile The user profile /etc/nmh/mts.conf nmh mts configuration file PROFILE COMPONENTS
None SEE ALSO
dp(8), Standard for the Format of ARPA Internet Text Messages (RFC-822) DEFAULTS
`-format' defaults as described above `-normalize' `-width' defaults to the width of the terminal CONTEXT
None BUGS
The argument to the -format switch must be interpreted as a single token by the shell that invokes ap. Therefore, one must usually place the argument to this switch inside quotes. MH.6.8 11 June 2012 AP(8)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy