Is there an option, for cat, head, tail, or is there any way, to display a file from last line to first? For example, my file
looks like this:
aaaa
bbbb
cccc
eeee
and I would like to print or display it like this:
eeee
cccc
bbbb
aaaa
thanks (5 Replies)
Hi
I want to read a flat file and add a word/value at the end of each line in the file and store the output in a temporary file. How can i do this? Plz help me with this.
Regards,
Saurabh (6 Replies)
Hi,
how could you go about removing words that begin with a certain character.
assuming that this character is '-' I currently have
echo "-hello" | sed s/-/""/
which replaces the leading dash with nothing but I want to remove the whole word, even if there are multiple words beginning... (3 Replies)
Well here goes:
I tried to write a batch file that adds a specific fixed text to each line of an already existing text file.
for the adding text infront of each line I tried this:
for /F "delims=" %%j in (list.txt) do echo.STARTTEXT\%%j >> list.txt
for adding text after each line I... (0 Replies)
how to add value/word at the beginning of each line in a file ?
i have file number.txt and the output is below
1000
1001
1002
1003
1004
i want to add 000 at the beginning of each line, desire output is below
0001000
0001001
0001002
0001003
0001004
and so on
please advise how... (5 Replies)
It is very simple to remove a hyphen from a word anywhere in that word using a simple sed command (sed -i 's/-//g' filename), but I am not able to figure out how to do this:
For example,
apple
-orange
tree
pipe-
banana-shake
dupe-
What my output should look like:
apple
orange
tree... (1 Reply)
Hi,
I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|".
I am looking for some command/option to join these two in single command parameter.
... (6 Replies)
I am trying to write a command and need to count all the words within the file which begin with the letter S
I have run this command
$ grep '^' TheAgileApproach.dat | wc -l
0
$ grep '^' TheAgileApproach.dat | wc -l
1
When I remove the wc -l I see the output as below:
$ grep '^'... (7 Replies)
I have a file similar to the below. I am selecting only the paragraphs with @inlineifset.
I am using the following command
sed '/@inlineifset/,/^ *$/!d;
s/@inlineifset{mrg, @btpar{@//' $flnm >> $ofln
This produces
@section Correlations between
seismograms,,,,}}
... (5 Replies)
Discussion started by: Danette
5 Replies
LEARN ABOUT BSD
lofi
lofi(7D) Devices lofi(7D)NAME
lofi - Loopback file driver
DESCRIPTION
The lofi file driver exports a file as a block device. Reads and writes to the block device are translated to reads and writes on the
underlying file. This is useful when the file contains a file system image. Exporting it as a block device through the lofi file driver
allows normal system utilities to operate on the image through the block device (like fstyp(1M)fsck(1M), and mount(1M). This is useful for
accessing CD-ROM and FAT floppy images. See lofiadm(1M) for examples.
File block device entries are contained in /dev/lofi, while /dev/rlofi contains the character (or raw) device entries. Entries are in the
form of decimal numbers which are assigned through lofiadm(1M). When created, these device entries are owned by root, in group sys, and
have permissions 0600. While ownership, group, and permission settings can be altered, there are possible ramifications. See lofiadm(1M)
for more information.
FILES
/dev/lofictl
Master control device
/dev/lofi/n
Block device for file n
/dev/rlofi/n
Character device for file n
/kernel/drv/lofi
32-bit driver
/kernel/drv/lofi.conf
Driver configuration file. (Should not be altered.)
/kernel/drv/sparcv9/lofi
64-bit driver
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsr, SUNWcarx.u |
+-----------------------------+-----------------------------+
SEE ALSO lofiadm(1M), fsck(1M), fstyp(1M), mount(1M), newfs(1M), attributes(5), lofs(7FS)NOTES
Just as you would not directly access a disk device that has mounted file systems, you should not access a file associated with a block
device except through the lofi file driver.
For compatability purposes, a raw device is also exported along with the block device. For example, newfs(1M) requires one.
SunOS 5.10 30 Jul 1999 lofi(7D)