Hello,
I am getting few text files with no EOF ( or end-of-line ) which i need to fix using a command so that i can include it in a script. Now i'm fixing this issue by opening the file in "vi" editor and adding last line.
e.g.,
server1#wc -l temp.txt
9 temp.txt
server1#cat ... (6 Replies)
I have a file something like:
a     b c    d
sdfsdf    f f   f
f   fffff
dfdf
Now when i read it as
while read line
do
echo $line
done< file
I get the o/p as
a b c d
sdfsdf f f f
f fffff
dfdf (5 Replies)
Hi,
I am reading data from file and storing it in a multiline variable. Every line is seperated with "\n" character.
globalstrval="${globalstrval}""${line}""\n"
If the value of globalstrval is like:
1234
ABCD
EFGH
WXYZ
....
If I do,
YLvar=`echo $globalstrval | grep "ABC"`
then... (1 Reply)
Hi,
This is the script and the error I am receiving
Can anyone please suggest ?
For the exmaple below assume we are using vg01
#!/bin/ksh
echo "##### Max Mount Count Fixer #####"
echo "Please insert Volume Group name to check"
read VG
lvs |grep $VG | awk {'print $1'} > /tmp/audit.log
... (2 Replies)
Hi ,
I am doing some enhancements in an existing shell script. There it used the awk command in a function as below :
float_expr() {
IFS=" " command eval 'awk "
BEGIN {
result = $*
print result
exit(result == 0)
}"'
}
It calls the function float_expr to evaluate two values ,... (1 Reply)
Hi,
I have a major problem in my source files. I have around 10 source files(around 20 GB).In one of the source files I am getting the broken line issue.My source files needs to be like this
Sr.No~Ref.No~Address~Acc.No
1~ABC345~No.2/110~456474
2~ABC786~4w/54~458695
... (4 Replies)
Heyas
I'm trying to read/display a file its content and put borders around it (tui-cat / tui-cat -t(ypwriter).
The typewriter-part is a 'bonus' but still has its own flaws, but thats for later.
So in some way, i'm trying to rewrite cat using bash and other commands.
But sadly it fails on... (2 Replies)
Hi All- we have performance issue in unix to read line by line.
I am looking at processing all the records.
description: Our script will read data from a flat file, it will pickup first four character and based on the value it will set up variables accordingly and appended the final output to... (11 Replies)
All- We have a performance issue in reading a file line by line. Please find attached scripts for the same. Currently it is taking some 45 min to parse "512444" lines.
Could you please have a look at it and provide any suggestions to improve the performance.
Thanks,
Balu
... (12 Replies)
I am trying to read the below file line by line for the below operation
i) extract the directory alone and assign it one variable
ii) extract the permission available in the line and add comma between the permissions and assign to another variable
iii) Finally apply setfacl logic as shown in... (3 Replies)
Discussion started by: sarathy_a35
3 Replies
LEARN ABOUT OPENSOLARIS
fmt
fmt(1) User Commands fmt(1)NAME
fmt - simple text formatters
SYNOPSIS
fmt [-cs] [-w width | -width] [inputfile]...
DESCRIPTION
fmt is a simple text formatter that fills and joins lines to produce output lines of (up to) the number of characters specified in the -w
width option. The default width is 72. fmt concatenates the inputfiles listed as arguments. If none are given, fmt formats text from the
standard input.
Blank lines are preserved in the output, as is the spacing between words. fmt does not fill nor split lines beginning with a `.' (dot), for
compatibility with nroff(1). Nor does it fill or split a set of contiguous non-blank lines which is determined to be a mail header, the
first line of which must begin with "From".
Indentation is preserved in the output, and input lines with differing indentation are not joined (unless -c is used).
fmt can also be used as an in-line text filter for vi(1). The vi command:
!}fmt
reformats the text between the cursor location and the end of the paragraph.
OPTIONS -c Crown margin mode. Preserve the indentation of the first two lines within a paragraph, and align the left margin of
each subsequent line with that of the second line. This is useful for tagged paragraphs.
-s Split lines only. Do not join short lines to form longer ones. This prevents sample lines of code, and other such for-
matted text, from being unduly combined.
-w width | -width Fill output lines to up to width columns.
OPERANDS
inputfile Input file.
ENVIRONMENT VARIABLES
See environ(5) for a description of the LC_CTYPE environment variable that affects the execution of fmt.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO nroff(1), vi(1), attributes(5), environ(5)NOTES
The -width option is acceptable for BSD compatibility, but it may go away in future releases.
SunOS 5.11 9 May 1997 fmt(1)