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
symlink
symlink(2) System Calls symlink(2)
NAME
symlink - make a symbolic link to a file
SYNOPSIS
#include <unistd.h>
int symlink(const char *name1, const char *name2);
DESCRIPTION
The symlink() function creates a symbolic link name2 to the file name1. Either name may be an arbitrary pathname, the files need not be on
the same file system, and name1 may be nonexistent.
The file to which the symbolic link points is used when an open(2) operation is performed on the link. A stat() operation performed on a
symbolic link returns the linked-to file, while an lstat() operation returns information about the link itself. See stat(2). Unexpected
results may occur when a symbolic link is made to a directory. To avoid confusion in applications, the readlink(2) call can be used to read
the contents of a symbolic link.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned, errno is set to indicate the error, and the symbolic link is not
made.
ERRORS
The symlink() function will fail if:
EACCES Search permission is denied for a component of the path prefix of name2.
EDQUOT The directory where the entry for the new symbolic link is being placed cannot be extended because the user's quota of disk
blocks on that file system has been exhausted; the new symbolic link cannot be created because the user's quota of disk
blocks on that file system has been exhausted; or the user's quota of inodes on the file system where the file is being
created has been exhausted.
EEXIST The file referred to by name2 already exists.
EFAULT The name1 or name2 argument points to an illegal address.
EILSEQ The path argument includes non-UTF8 characters and the file system accepts only file names where all characters are part of
the UTF-8 character codeset.
EIO An I/O error occurs while reading from or writing to the file system.
ELOOP Too many symbolic links are encountered in translating name2.
ENAMETOOLONG The length of the name2 argument exceeds PATH_MAX, or the length of a name2 component exceeds NAME_MAX while
_POSIX_NO_TRUNC is in effect.
ENOENT A component of the path prefix of name2 does not exist.
ENOSPC The directory in which the entry for the new symbolic link is being placed cannot be extended because no space is left on
the file system containing the directory; the new symbolic link cannot be created because no space is left on the file sys-
tem which will contain the link; or there are no free inodes on the file system on which the file is being created.
ENOSYS The file system does not support symbolic links.
ENOTDIR A component of the path prefix of name2 is not a directory.
EROFS The file name2 would reside on a read-only file system.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
cp(1), link(2), open(2), readlink(2), stat(2), unlink(2), attributes(5)
SunOS 5.11 18 May 2007 symlink(2)