06-16-2006
how to know whether that file has eol or noeol before opening that file in VI editor
Hi,
I want to check whether file has EOL or NOEOL before opening this file in VI editor. My file is very big its in terms of 15-20 MB.
I am using ksh for this.
When we opened the file in vi editor, normally at last line we are able to see whether this is eol or noeol file. But i does want to check manually like this.
Please suggest me on this.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am using ksh.
I have to find wether data file has EOL or not. as per my knowledge we can easily find by checking each character. But this is a tedious job as per my requirement because my data file size is very big . It may be in 25-30 MB.
So please advice me how i can check wether... (4 Replies)
Discussion started by: HariRaju
4 Replies
2. Shell Programming and Scripting
Hi,
Just consider there are around 10 lines in a file. Now is it possible to delete the first 2 lines in the file without opening the file. No matter whatever the content of the file is, I just wanna delete the first 2 lines without opening the file. Is that possible? If so, please help me out.... (3 Replies)
Discussion started by: toms
3 Replies
3. Shell Programming and Scripting
Hi All,
I am new to shell scripting but have successfully created some of my own scripts using awk and sed. However, I have come across a problem that I cannot solve on my own and have not been able to find a good example that relates to what I am trying to do.
What I need is for the... (4 Replies)
Discussion started by: kixazz2529
4 Replies
4. Shell Programming and Scripting
cat can't show the last line of a file sftp transffered from Windows, because the last line is not ended with new line.
Vi can show all line with warning
I can append blank line in order for cat to show all lines, But is there a command to do this without modifying the file?
> cat -A... (3 Replies)
Discussion started by: honglus
3 Replies
5. UNIX for Dummies Questions & Answers
if we happen to have a very big .csv file we cannot or dont care to edit,
is there a way to check if the file contains a header row? (2 Replies)
Discussion started by: lydiaflamp
2 Replies
6. Shell Programming and Scripting
Dear All,
this is my first post on this Forum, glad to be here.
I'm trying to fix an .ods file. Yes, I had a backup, but it's also corrupted.
When opening the document I get this EM:
read error
format error discovered in the file in sub-document content.xml at
2,337040(row,col).
So I... (3 Replies)
Discussion started by: jameslast
3 Replies
7. OS X (Apple)
I was editing a file with vi and crashed so when I opened the file again I had the .swp file to deal with. I made the wrong choice trying to recover my file and wound up with a file with no eol (end of line) characters.
I have forgotten the code to substitute and don't want to make an even... (2 Replies)
Discussion started by: gale
2 Replies
8. Shell Programming and Scripting
Hi friends,
In my shell script, I want to open a file using vi editor. After opening the file in vi, I want to save and quit this file automatically.... all through shell script.
the code segment is:
------------------------------------------------------------
cd ~/netfpga/projects/scone/sw/... (2 Replies)
Discussion started by: sachinteotia
2 Replies
9. AIX
Below is the error:
Out of memory saving lines for undo - try using ed
:
Please help me how do I open this file.
Best regards,
Vishal (5 Replies)
Discussion started by: Vishal_dba
5 Replies
10. UNIX for Dummies Questions & Answers
I have file called "text". The contents are as below :
aaa
bbb
ccc
ddd
eee
ffff
ddd
hhhh
iiii
I want to read this file without opening and and delete the last line. How can it be done? (4 Replies)
Discussion started by: the_hunter
4 Replies
OPEN(1) BSD General Commands Manual OPEN(1)
NAME
open -- open files and directories
SYNOPSIS
open [-e] [-t] [-f] [-F] [-W] [-R] [-n] [-g] [-h] [-b bundle_identifier] [-a application] file ... [--args arg1 ...]
DESCRIPTION
The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is speci-
fied, the default application as determined via LaunchServices is used to open the specified files.
If the file is in the form of a URL, the file will be opened as a URL.
You can specify one or more file names (or pathnames), which are interpreted relative to the shell or Terminal window's current working
directory. For example, the following command would open all Word files in the current working directory:
open *.doc
Opened applications inherit environment variables just as if you had launched the application directly through its full path. This behavior
was also present in Tiger.
The options are as follows:
-a application
Specifies the application to use for opening the file
-b bundle_indentifier
Specifies the bundle identifier for the application to use when opening the file
-e Causes the file to be opened with /Applications/TextEdit
-t Causes the file to be opened with the default text editor, as determined via LaunchServices
-f Reads input from standard input and opens the results in the default text editor. End input by sending EOF character (type Control-D).
Also useful for piping output to open and having it open in the default text editor.
-F Opens the application "fresh," that is, without restoring windows. Saved persistent state is lost, except for Untitled documents.
-W Causes open to wait until the applications it opens (or that were already open) have exited. Use with the -n flag to allow open to func-
tion as an appropriate app for the $EDITOR environment variable.
-R Reveals the file(s) in the Finder instead of opening them.
-n Open a new instance of the application(s) even if one is already running.
-g Do not bring the application to the foreground.
-h Searches header locations for a header whose name matches the given string and then opens it. Pass a full header name (such as NSView.h)
for increased performance.
--args
All remaining arguments are passed to the opened application in the argv parameter to main(). These arguments are not opened or inter-
preted by the open tool.
EXAMPLES
"open '/Volumes/Macintosh HD/foo.txt'" opens the document in the default application for its type (as determined by LaunchServices).
"open '/Volumes/Macintosh HD/Applications/'" opens that directory in the Finder.
"open -a /Applications/TextEdit.app '/Volumes/Macintosh HD/foo.txt'" opens the document in the application specified (in this case, TextE-
dit).
"open -b com.apple.TextEdit '/Volumes/Macintosh HD/foo.txt'" opens the document in the application specified (in this case, TextEdit).
"open -e '/Volumes/Macintosh HD/foo.txt'" opens the document in TextEdit.
"ls | open -f" writes the output of the 'ls' command to a file in /tmp and opens the file in the default text editor (as determined by
LaunchServices).
"open http://www.apple.com/" opens the URL in the default browser.
"open 'file://localhost/Volumes/Macintosh HD/foo.txt'" opens the document in the default application for its type (as determined by Launch-
Services).
"open 'file://localhost/Volumes/Macintosh HD/Applications/'" opens that directory in the Finder.
"open -h NSView" lists headers whose names contain NSView and allows you to choose which ones to open.
"open -a Xcode -h NSString.h" quickly opens /System/Library/Frameworks/Foundation.framework/Headers/NSString.h in Xcode.
HISTORY
First appeared in NextStep.
Mac OS X February 10, 2004 Mac OS X