I was reading this and thought I could put this in my vimrc and it would convert the line endings to unix. Am I doing something wrong or am I missing something?
I used this command and it confirms that my global option is set to unix. I edited the file a little bit and saved it but it didn't convert it to unix. It remained in the dos format.
Hi There, :)
I Need to put the following command in the vimrc for the execution of ECLIPSE
so I have written smthing like as follows,
export PATH=$PATH:/JVM location
after this i go to my eclipse folder and when I execute STILL it is not getting opened.....
Any Help that makes my... (6 Replies)
Hello
I have created the following script, which is designed to manipulate a text document:
#!/bin/sh
# Get 3 lines, (last of which is "Quantity"); adjust order; put all three on one line with tabs.
FILENAME=~/Desktop/email.txt
LIST=$(grep -B2 "Quantity" ${FILENAME} |awk 'BEGIN { FS = "\n"; RS... (6 Replies)
I was reading these 2 articles. Why does the wikia one think :e ++ff=dos? Or am I just misunderstanding it?
:e ++ff=unix
:e ++ff=dos
File format - Vim Tips Wiki
Managing/Munging Line-Endings with Vi/Vim | Jeet Sukumaran (1 Reply)
When you are dealing with ASCII files it easy to check on line endings type. You can just use the file command. You are not always lucky enough to be dealing with ASCII files. So in the cases that you don't have ASCII files how can you check what type of line endings you have? Please list all... (5 Replies)
Hello all. Hope you can help. I am looking for a complete command to search for a file named HOSPCHK. The file could be listed with numbers after it like it could be listed with letters after it or a combination of both or just by it self. The other catch is the file that I want to look for... (27 Replies)
I'm having trouble getting my vimrc to work the way I want it. For some reason after I hit enter it is creating tabs instead of spaces like I would expect. Here is an example of what I am talking about. $ = newline, ^I = tab. On the line of struct EDGETAG* q; I hit enter and it created a tab... (2 Replies)
Hi,
1. I'm using tcsh and I use a .gvimrc file which was working fine with my previous ksh shell. But while sourcing, I'm getting messages like 'Unmatched " '. I'm not trying anything fancy but just using " for commenting in the very first line and I see the error is thrown right there.
2.... (2 Replies)
Mails from Sendmail are ignoring line endings, when I try to send email with attachment. I have tried to specify the font in the html but line endings are still ignored. I also tried unix2dos, still no luck.
#!/usr/bin/ksh
###Send Email
MAILTO=`cat mail2.list | tr -s '\n' ','`
SUBJECT="bla bla... (3 Replies)
Hi,
At the moment, using Notepad++ to do a search and replace, manually section by section which is real painful. Yeah, so copying each section of the line of text and putting into a file and then search and replace, need at least 3-operations in Notepad++.
Here's hoping I will be able to... (1 Reply)
Discussion started by: newbie_01
1 Replies
LEARN ABOUT PHP
fgets
FGETS(3) 1 FGETS(3)fgets - Gets line from file pointerSYNOPSIS
string fgets (resource $handle, [int $length])
DESCRIPTION
Gets a line from file pointer.
PARAMETERS
o $handle
-The file pointer must be valid, and must point to a file successfully opened by fopen(3) or fsockopen(3) (and not yet closed by
fclose(3)).
o $length
- Reading ends when $length - 1 bytes have been read, or a newline (which is included in the return value), or an EOF (whichever
comes first). If no length is specified, it will keep reading from the stream until it reaches the end of the line.
Note
Until PHP 4.3.0, omitting it would assume 1024 as the line length. If the majority of the lines in the file are all larger
than 8KB, it is more resource efficient for your script to specify the maximum line length.
RETURN VALUES
Returns a string of up to $length - 1 bytes read from the file pointed to by $handle. If there is no more data to read in the file
pointer, then FALSE is returned.
If an error occurs, FALSE is returned.
CHANGELOG
+--------+-----------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+-----------------------------+
| 4.3.0 | |
| | |
| | fgets(3) is now binary safe |
| | |
+--------+-----------------------------+
EXAMPLES
Example #1
Reading a file line by line
<?php
$handle = @fopen("/tmp/inputfile.txt", "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
echo $buffer;
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail
";
}
fclose($handle);
}
?>
NOTES
Note
If PHP is not properly recognizing the line endings when reading files either on or created by a Macintosh computer, enabling the
auto_detect_line_endings run-time configuration option may help resolve the problem.
Note
People used to the 'C' semantics of fgets(3) should note the difference in how EOF is returned.
SEE ALSO fgetss(3), fread(3), fgetc(3), stream_get_line(3), fopen(3), popen(3), fsockopen(3), stream_set_timeout(3).
PHP Documentation Group FGETS(3)