example
- shsk
mss-sdsd-asd
i need a command which will search for staring word not others
it should search only -shsk
cat filename | grep '-'
will search whole '-' in the file but i need to search only staring '-'
thank u
revenna (1 Reply)
Hi Guys,
I have a file like this:
wwwe 1 ioie ewew yyy uuu 88
erehrlk 4 ihoiwhe lkjhassad lkhsad yyy mmm 45
jhash lhasdhs lkhsdkjsn ouiyrshroi oihoihswodnw oiyhewe yyy ggg 77
I want to remove everything after "yyy" and including "yyy" from each line in the file.
So I want:... (2 Replies)
Hi Geeks,
Consider this line:
driver=c:\folder1\folder2
The above line is contained in a variable say 'var' . I want to copy everything after 'driver=' in to another variable say var2.
Please tell me how can this be done. (8 Replies)
Hi,
I have to search a word in a text file and then I have to delete lines above from the word searched . For eg suppose the file is like this:
Records
P1
10,23423432
,77:1
,234:2
P2
10,9089004
,77:1
,234:2
,87:123
,9898:2
P3
456456
P1
:123,456456546
P2
abc:324234 (2 Replies)
Hi All,
I have a file in which a number of lines are starting with similar first word but different next words.
I want to replace the any nth word(not 1st or 2nd) with another word.
Eg:- My file contains are like this:-
Ram is a boy.
Ram is a good boy.
Ram plays cricket.
Here I want to... (2 Replies)
Hi,
I have multiple files of same format and I want to delete the lines starting with # and The from all of them
I am using
egrep -v '^(#|$)'
for # but unable to do for both # and The
Please guide
Thanks (12 Replies)
Hi All,
Hope you guys had a wonderful weekend
I have a scenario where in which I have to read a file line by line
and check for few words before redirecting to a file
I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
I have a file: file.txt, which contains the following data in it.
This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt
My name is not Karl, my name is Karl Joey
What is your name?
Do you know your name and... (3 Replies)
e.g.
File name: File.txt
cat File.txt
Result:
#INBOUND_QUEUE=FAQ1
INBOUND_QUEUE=FAQ2
I want to get the value for one which is not commented out.
Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies
LEARN ABOUT SUNOS
longline
readfile(1F) FMLI Commands readfile(1F)NAME
readfile, longline - reads file, gets longest line
SYNOPSIS
readfile filename
longline [filename]
DESCRIPTION
The readfile function reads filename and copies it to stdout. No translation of NEWLINE is done. It keeps track of the longest line it
reads and if there is a subsequent call to longline, the length of that line, including the NEWLINE character, is returned.
The longline function returns the length, including the NEWLINE character, of the longest line in filename. If filename is not specified,
it uses the file named in the last call to readfile.
EXAMPLES
Example 1: Typical use of readfile and longline
Here is a typical use of readfile and longline in a text frame definition file:
.
.
.
text="`readfile myfile`"
columns=`longline`
.
.
.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO cat(1), attributes(5)DIAGNOSTICS
If filename does not exist, readfile will return FALSE (that is, the expression will have an error return).
longline returns 0 if a readfile has not previously been issued.
NOTES
More than one descriptor can call readfile in the same frame definition file. In text frames, if one of those calls is made from the text
descriptor, then a subsequent use of longline will always get the longest line of the file read by the readfile associated with the text
descriptor, even if it was not the most recent use of readfile.
SunOS 5.10 5 Jul 1990 readfile(1F)