Vim line length...

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Vim line length...
# 1  
Old 05-22-2015
Vim line length...

The vi(m) text editor...

Google is not my friend here...

I have already found out that it is possible to save a pure text file without the '0x0A' newline character at the very end of the file but I can't find anything on the next question.

I have written a raw audio file to quantised pure text converter.

This converts a 0 to 255 level binary file centred on 128, to a 32 to 126 level text file of the same audio centred on 79. That is the minimum is a space character and the maximum is a tilde character centred on 'O'.

The file a a pure flat file of random characters and can be a minimum of 8000 bytes in size but could be virtually unlimited above that.

Q: Is there a line limit set in vi(m), and if yes, can it be altered?

(Gedit is OK with 8000 ASCII bytes but adds a newline at the end...)

TIA...
# 2  
Old 05-22-2015
Hi Wisecracker,

From memory (a dim and distant one) there was a limit of 1023 characters plus a new line. But then it was 16bit cutting edge technology, I would have imagined that things would have moved on.

Regards

Gull

---------- Post updated at 11:12 PM ---------- Previous update was at 10:52 PM ----------

Hi wisecracker,

I've just tried vim version 7.2.411 with lines of 10k and no problem.

Gull
# 3  
Old 05-22-2015
I think I'm missing the point.

What editing commands do you want to apply to the long, incomplete line of data in your raw audio file(s)?
# 4  
Old 05-22-2015
If there could be nul (ox00) bytes in there; vim will need the -b option to correctly read in the entire record. - assuming I understand what you are asking. And yes, vim can handle file records longer than LINE_MAX.

However, modifying a single huge binary string with an editor like vim is not easy. I use UltraEdit with hexedit set on. UltraEdit is not available for OSX, AFAIK. BLV may be. I dunno.
# 5  
Old 05-23-2015
Hi Don..

I am working on a shell script, Arbitrary Audio Waveform Generator. I created the audio file in pure text mode to check if there was any major degradation of a sampled 1 second audio signal compared to the original 8 bit binary version. Yes there was/is very minor degradation to the ear and obviously because there is less swing in the overall amplitude the output level is less. I considered that OK for this kids level project.

I therefore want an editor that is able to create very large flat text files and save without a newline at the end...

However I might create my own simple version and inlude a simple on window display of this waveform too at the same time as creating it. I don't know how hard this will be in shell scripting but I willing to attempt such an oddity.

Hi Jim...

There will be NO character values between 0 and 31 decimal and 127 to 255 inclusive, so no need for a hex editor, (I already have a hex editor on my desktop)...

Yeah I know, a strange requirement but my niche is creating simple measuring gear HW and writing code to suit. As my language of choice is *NIX bash scripting then I am going down that road...
# 6  
Old 05-23-2015
You can create huge files with no newline characters with:
Code:
printf '%s' "$waveform" "$waveform2" ... > file

and add as many more waveforms to the end of that file as you want with:
Code:
printf '%s' "$waveform3" "$waveform4" ... >> file

I repeat: What editing commands do you want to apply to the long, incomplete line of data in your raw audio file(s)?

You may well be able to use portable printf, cut, and paste commands without needing to worry about text editors' desires to work with lines terminated by a newline with lengths no longer than LINE_MAX bytes.
This User Gave Thanks to Don Cragun For This Post:
# 7  
Old 05-23-2015
Hi Don...

Hope this lot is lucid...

There was just a few to be manually done...
Code:
Go to column <n>. (Row will always be 1).
Delete character and replace.
Save and exit without a newline...

cut and paste duly noted...

However; I am working on an on-window full screen text editor that displays the waveform and changes any selected character and redraws the new waveform and places it into a variable and when finished this variable will then be played through SOX.
This will have the option of saving it using printf or just losing it on exiting the code...

The waveform will be approximate as viewed as I can only obtain 47 rows from the MBPs default terminal and when multiplied by 2 gives 94 levels inclusive. The 94, (95), level accuracy is maintained however, just the image is not so accurate.

I hope to have a DEMO idea working in the not too distant future...

All in text - EEK!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check for length which exceeds specified length in a line

Hi, I have a issue, I need to loop through a comma delimited file and check for the length which exceeds specified length , if Yes truncate the string. But my problem is , I do not have to check for all the fields and the field lenght is not same for all the fields. For ex: Say my line... (9 Replies)
Discussion started by: rashmisb
9 Replies

2. UNIX for Dummies Questions & Answers

vim copy line and paste at the beginning, middle, and end of another line

How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
Discussion started by: cokedude
3 Replies

3. Solaris

Very Importan - Vim Settings - Error while opening a File using vim

I downloaded vim.7.2 and compiled the vim source . Added the vim binary path to PATH (Because iam not the root of the box) when i load the file using vim it throws me an error Error detected while processing /home2/e3003091/.vimrc: line 2: E185: Cannot find color scheme darkblue line... (0 Replies)
Discussion started by: girija
0 Replies

4. UNIX for Advanced & Expert Users

vim editor -> uncounted new line

Hi, I entered the following text in a new file through vim: "Four score and seven years ago" saved and exit. When I looked at the file size, it was 31B, although is supposed to be 30. I reedited the file (again with vim) to check for errors, but everything seemed fine. When I opened the file... (3 Replies)
Discussion started by: prostiiinet
3 Replies

5. UNIX for Dummies Questions & Answers

VIM: replace a character in the middle of line

exmaple, i need to replace the number "5" from all lines below with "X"? What is the useful vim command that i can apply for.. ddpadsgg506xghssuyj ddpadsgag546xghssuys ddsadsgaag596xghssuy_te ddsadsgag506xghssuy_pe ddsadsgagc526xghssuys ddsads506ighssuys ddsadsgag506pghssuyk (1 Reply)
Discussion started by: 793589
1 Replies

6. Shell Programming and Scripting

Deleting Characters at specific position in a line if the line is certain length

I've got a file that would have lines similar to: 12345678 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 23456781 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 34567812 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 45678123 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 xx.00... (10 Replies)
Discussion started by: Cailet
10 Replies

7. UNIX for Advanced & Expert Users

how to go previous line in vim

hi, suppose my cursor is on 15 th line in vim i want to go 105 th line and directly come to 15 line from there is any shot key in vim to come directly to previous line ? (2 Replies)
Discussion started by: useless79
2 Replies

8. UNIX for Advanced & Expert Users

line completion in vim

how we achive line completion and word completion in vim editor? (2 Replies)
Discussion started by: lakshmananindia
2 Replies

9. UNIX for Dummies Questions & Answers

remember last visited line in vim

hi, I know we can do this; but dont know how.. I open a file using vim..browse thru it and then say :wq after reaching some line; The next time I open the same file, I want vim to position the cursor on the line where I left last time; anyone? (2 Replies)
Discussion started by: spopuri
2 Replies

10. UNIX for Dummies Questions & Answers

vim as command line editor

Here is my problem, I manage a SunOs 5.8 Server, vi is the default command line editor, I have a line on each users .kshrc profile as follows: export EDITOR=/bin/vi I want to use vim as the command line editor, the below line doesn't work export EDITOR=/bin/vim Thank you (1 Reply)
Discussion started by: tony3101
1 Replies
Login or Register to Ask a Question