06-20-2008
delimitted file to fixed length file
Hi, Iam new to unix. I have a variable length file seperated by delmitter "~", I need to change it to fixed length file including space instead of delimitter. To be clear.....
Input file:
Row-id name
123~name1
124~name2
125~name3
The above input file is a variable length file seperated by delimiter ~ and row-id is of 5 character length and name is a varchar of 20.
Output file:
row-id name
123 name1
124 name2
125 name3
The above is a fixed length file which has to be send to mainframe team. so they need a fixed length file.
Please let me know how to change a varaible length file to fixed length file. Thanks in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
If someone out there could help me out with this problem. I would really appreciate it.
I am trying to convert xml into text file(fixed length) using Unix Borne shell scripts.
My xml file:
<root>
<header_rec recordtype="00">
<record_id>00</record_id>
... (0 Replies)
Discussion started by: ram2s2001
0 Replies
2. Shell Programming and Scripting
I want to copy a existing file to a fixed length file. Thanks , I used awk getline and infuntion mode was using 0 as end of file. and length to give but the programs comes out without doing anything
I need the help
CM (3 Replies)
Discussion started by: cmanand
3 Replies
3. Shell Programming and Scripting
I have below fixed lenth file . I have to convert this to delimitted file.
File1.txtE116005/29/19930E001E000
E12201/23/19940E001E003
E10406/4/19940E001E003
I want to convert this to :
E116,0,05/29/1993,0,E001,E000
E122,0,1/23/1994,0,E001,E003
E104,0,6/4/1994,0,E001,E003
I have a... (7 Replies)
Discussion started by: satyam_sat
7 Replies
4. UNIX for Dummies Questions & Answers
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
5. UNIX for Dummies Questions & Answers
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
6. Shell Programming and Scripting
hi ,
i need to convert fixed length file to delimited file using unix where length of each column is variable (2 Replies)
Discussion started by: Nishithinfy
2 Replies
7. Shell Programming and Scripting
Hello
I've question on the requirement I am working on.
We are getting a fixed length file with "33" characters long. We are processing that file loading into DB.
Now some times we are getting a file with "35" characters long. In this case I have to remove two characters (in 22,23... (14 Replies)
Discussion started by: manasvi24
14 Replies
8. Shell Programming and Scripting
Hi,
I need to split a fixed length file of 160 characters based on value of a column. Example:
ABC 456780001 DGDG SDFSF
BCD 444440002 SSSS TTTTT
ABC 777750003 HHHH UUUUU
THH 888880001 FFFF LLLLLL
HHH 999990002 GGGG OOOOO
I need to split this file on basis of column from... (7 Replies)
Discussion started by: Neelkanth
7 Replies
9. UNIX for Dummies Questions & Answers
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. UNIX for Beginners Questions & Answers
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
LEARN ABOUT OPENSOLARIS
net_instance_notify_register
net_instance_notify_register(9F) Kernel Functions for Drivers net_instance_notify_register(9F)
NAME
net_instance_notify_register, net_instance_notify_unregister - add/delete a function to be called for changes to an instance
SYNOPSIS
#include <sys/hook.h>
#include <sys/neti.h>
int net_instance_notify_register(net id_t net_id,
hook_notify_fn_t *callback, void *arg);
int net_instance_notify_unregister(net id_t net_id,
hook_notify_fn_t *callback);
typedef int (* hook_notify_fn_t)(hook_notify_cmd_t command,
void *arg, const char *name1, const char *name2, const char
*name3);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI).
PARAMETERS
netid value from either callback registered with net_instance_register() or net_zoneidtonetid().
callback function to call when a change occurs.
arg pointer to pass into the callback() function when a change occurs.
DESCRIPTION
The net_instance_notify_register() function registers a function represented by the pointer callback to be called when there is a new
instance added or removed from the given network instance (represented by netid.)
The net_instance_notify_unregister() function indicates that there is no longer any desire to receive notification of changes to the
instance through function calls to the specified callback.
Multiple callback functions may be registered through this interface. The same set of parameters is passed to each callback function. The
memory referenced through the pointers passed to the callback should be treated as pointing to read-only memory. Changing this data is
strictly prohibited.
The function that is called must not block any other events.
The arguments passed through to the callback are as follows (the command is either HN_REGISTER or HN_UNREGISTER):
name1 is the netid represented as a string.
name2 is NULL.
name3 is the name of the instance being added/removed
RETURN VALUES
If these functions succeed, 0 is returned. Otherwise, the following error is returned:
EEXIST the given callback function is already registered.
CONTEXT
These functions may be called from user or kernel context.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
SEE ALSO
attributes(5), net_instance_register(9F), net_instance_unregister(9F), net_zoneidtonetid(9F)
SunOS 5.11 30 Oct 2008 net_instance_notify_register(9F)