Line Terminator


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Line Terminator
# 1  
Old 02-27-2006
Line Terminator

Hi Guys,

This is Narasa i am new to this forum.I am very proud to join this forum.

I have a question on Line termination for fixed length file.

We got a file from mainframe having fixed length of 587 but when i extract the zip file with notepad it looks like continuous line with out any line termination.

I want to make a lene termination after record lenght of 587.

Can please suggest me how to handle this file.

Thanks in advance
Narasa
# 2  
Old 02-27-2006
some thing like this:
$ sed -e '588,$d' your_file > file_without_lins
# 3  
Old 02-27-2006
Try this

Use fold

For eg:
For specifying number of columns.
fold -w 587 <filename>

For specifying number of bytes.
fold -b 587 <filename>

Remember this works on the stream. So capture the output in another file.
# 4  
Old 02-27-2006
Thanks for quick come out.
After i did ftp from PC to Unix i did WC (word count)the result is like this
0 246989 8172801 narasa.txt

After i used $ sed -e '588,$d'
the result is same.
why i am getting zero line count. Please advice me.

Thanks in advance
Narasa

Last edited by narasa; 02-27-2006 at 06:46 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Record terminator on alternate line

Hello All, I have csv file like this 1,"suzi","305 Barehills","Vancover",34256 2,"molly","456 beverleyhills","Minisotta",234876 I want to put a customized record terminator on every alternate lines of this file. The file is a input to database and the record terminator is by default... (3 Replies)
Discussion started by: nnani
3 Replies

2. UNIX for Dummies Questions & Answers

Terminator for SunOS 5.10

Hi, I am trying to install Terminator (terminal emulator) on SunOS 5.10. But on their page I do not see download for this one: code . google . com / p / jessies / downloads / list software . jessies . org / terminator / #downloads Did anyone manage to to this, and if it is, can please give... (3 Replies)
Discussion started by: spuzh
3 Replies

3. Shell Programming and Scripting

<< terminator not found error

I am using the following script. I am basically trying to enter data to my database using a storeprocedure. PFB MY script. #!/bin/csh -f foreach FF (`cat ADDUSERS`) isql -VENKIDB -U gloss -P glosss << _endl set nocount on go use VENKI_PROD go print "Adding the user to GSTB... (6 Replies)
Discussion started by: venkidhadha
6 Replies

4. UNIX for Dummies Questions & Answers

adding line terminator

Can someone help , how to add a terminator at the end of each line through shell command. ex: input file: abc xyz2 outputfile (terminator is !) abc! xyz2! (1 Reply)
Discussion started by: thanuman
1 Replies

5. UNIX for Dummies Questions & Answers

Writing data onto new lines based on terminator

I have a requirement, where based on a particular character on a single line, the data has to be written to new lines... Ex: abccd$xyzll$bacc$kkklkjl$albc My output should be abccd$ xyzll$ bacc$ kkklkjl$ albc Can someone help on this. (1 Reply)
Discussion started by: thanuman
1 Replies
Login or Register to Ask a Question