Lines too long error


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Lines too long error
# 1  
Old 05-07-2008
Lines too long error

Hi Gurus,
I have a big file having around 5000 lines. What I need to do is as below.

$cat myfile
aaaa
bbbb
ccc
ddd
...

I want the output to be as below:

'aaaa,'bbbb','cccc'....

For this I have written something like this

code:
vi sac.txt |nawk '{printf NR","}'>ss
code:

But here the problem is when I try to open the file "ss", it says "Lines to long"

Please helpl me!!!!
# 2  
Old 05-07-2008
vi, ed and most command line utilities have a line length limit. Your file, ss, has a line that is too long to read.

1. make the lines shorter
2. use something else to edit the file
# 3  
Old 05-09-2008
Quote:
Originally Posted by thana
Hi Gurus,
I have a big file having around 5000 lines. What I need to do is as below.

$cat myfile
aaaa
bbbb
ccc
ddd
...

I want the output to be as below:

'aaaa,'bbbb','cccc'....

For this I have written something like this

code:
vi sac.txt |nawk '{printf NR","}'>ss
code:

But here the problem is when I try to open the file "ss", it says "Lines to long"

Please helpl me!!!!
Maybe you can use the nedit program to open the "ss" file.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Break one long string into multiple fixed length lines

This is actually a KSH under Unix System Services (Z/OS), but hoping I can get a standard AIX/KSH solution to work... I have a very large, single line file in Windows, that we download via FTP, with the "SITE WRAP" option, into a Z/OS file with an LRECL of 200. This essentially breaks the single... (4 Replies)
Discussion started by: bubbawuzhere
4 Replies

2. UNIX for Dummies Questions & Answers

sed and awk for long lines

Hi, I'm trying make a variable length file to a fixed length of 4000. I'm to pad spaces on the right of a record if length is less than 4000 to make the record length 4000. I'm trying to use the below commands awk '{printf "%-4000s\n", $0}' inputfile.dat > outputfile.dat sed -e :a... (12 Replies)
Discussion started by: uxusr
12 Replies

3. UNIX for Dummies Questions & Answers

Bash does not wrap long lines correctly

Ksh is my default shell, but I want use the bash shell since its convenient to me. When I type a long command line in a terminal, it does not wrap to the next line when I reach the end of the line and it wraps onto the same line, overwriting my prompt and the rest of what I typed. $... (5 Replies)
Discussion started by: senthil.ak
5 Replies

4. Shell Programming and Scripting

Long line displayed as multiple lines in Outlook. Please help!

When a file generated by a shell script is sent as a mail (not as an attachment), in MS Outlook, single lines of the file are displayed as two/three lines (as the lines are long). Is there a way to make each line to be displayed in 'single line with scroll bar' to enable viewing of the long line? (2 Replies)
Discussion started by: thulasidharan2k
2 Replies

5. Shell Programming and Scripting

Long line displayed as multiple lines in Outlook. Please help!

When a file generated by a shell script is sent as a mail (not an attachment), in MS Outlook, single lines of the file are displayed as two/three lines (as the lines are long). Is there a way to make each line to be displayed in 'single line with scroll bar' to enable viewing of the long line? ... (0 Replies)
Discussion started by: thulasidharan2k
0 Replies

6. Shell Programming and Scripting

Long lines in test.awk

I have a awk script called test.awk which I run using awk -f test.awk file1.txt > file2.txt I am doing a long print statement and want to put it in separate lines Do I need a '/' at the end or not????? Should it be like this print... (12 Replies)
Discussion started by: kristinu
12 Replies

7. Shell Programming and Scripting

splitting long string into several lines?

I'm using a barcode scanner to grab ISBNs. Unfortunately, short of hitting "enter" each time (not easy while on a ladder), there's no good way to split it up. So I scanned it into a series of long lines in notepad. Now, I need to split each line into 12-number lines. instead of:... (4 Replies)
Discussion started by: mbourgon
4 Replies

8. Shell Programming and Scripting

Breaking long lines into (characters, newline, space) groups

Hello, I am currently trying to edit an ldif file. The ldif specification states that a newline followed by a space indicates the subsequent line is a continuation of the line. So, in order to search and replace properly and edit the file, I open the file in textwrangler, search for "\r " and... (14 Replies)
Discussion started by: rowie718
14 Replies

9. UNIX for Dummies Questions & Answers

removing lines in a too long file

HI, i need to remove about a 3000000 lines in a "too long file", without using vi editor. Im using hp-ux 11.0. (4 Replies)
Discussion started by: Goodfella
4 Replies

10. Shell Programming and Scripting

Re: Long command lines

Hello, AIM: Need to test for the presence of some files (*.F) in a certain directory. having a problem with this line is ksh: if test `ls $SOMEDIR/dir/*.F \ 2>/dev/null|wc -w` -eq 0 Basically testing for the presence of *.F files in the specified directory. If the return... (4 Replies)
Discussion started by: enoch
4 Replies
Login or Register to Ask a Question