0

I have a file generated by a select statement and the resulting file has new lines at every 80th character.

I see the new lines in the file by tail,more ,cat,vim commands.

Althoug vim has a setting for folding files at a specific index ( and can be disabled as described in this post : Confusion about vim folding - how to disable? ) I suppose the file is generated this way in the first place.

So is there a setting which applies to whole OS and disable folding? Or is it only for vim?

EDIT:

I figured out that the new lines comes from the select statement, I added 'size line 300' at the top of the sql file. It solved the problem. Thanks for the replies.

Community
  • 1
  • 1
gne
  • 38
  • 6
  • 1
    What you describe has nothing to do with folding or Vim. You're describing wrapping of the lines. Are you sure they actual file has newlines inserted at column 80 or is that just the width of the terminal you're viewing it in, so the display of the lines are wrapped? – jamessan Jan 21 '16 at 15:52
  • `set nofoldenable` is only for vim. – dlmeetei Jan 21 '16 at 15:52
  • @jamessan Thanks for yur reply. Well it's not just a viewing issue I think since when I run the wc -l command it gives me the double of the expected number. – gne Jan 22 '16 at 08:30

1 Answers1

0

Folding means visual collapsing of multiple physical lines into a one-line summary; it is a feature of Vim (and several IDEs).

Wrapping is the process of continuing text at the next line if it gets too long. It can be hard by inserting actual newline characters (and I suspect that's what your select statement does), or soft by just changing the display so that you are able to see the characters (this can be toggled in Vim via the 'wrap' option).

So, the process of inserting newline characters is a property of the producing application; there may (or may not) be a (application-specific) way to influence this. You can also do post-processing of the resulting file, using Vim or command-line tools like sed or tr, in order to remove the newline characters.

Terminals, editors, and viewer applications usually perform wrapping of long lines, and often can be reconfigured.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • Yes new lines comes from select statement.I editted my question. Thanks for your reply. – gne Jan 22 '16 at 09:59
  • Glad I could help. Please mark the question as closed by accepting my answer. Just click on the outlined check mark next to it. Thanks! – Ingo Karkat Jan 22 '16 at 10:02