04-19-2012
Yes, that's neater. Sorry for being a fool and adding an
if that will cost CPU especially for a large file. I wasn't thinking.
Robin
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am fairly new to scripting. But I have been able to extract and format all of my information required into one file. My issue is that one character is on a separate line. I need to be able to add the character to the previous line.
ex.
abcdefghi
1
bcdefghij
3
cdefghijk
4
need to... (4 Replies)
Discussion started by: DUST
4 Replies
2. Shell Programming and Scripting
Is there a way to combine two lines onto a single line...append the following line onto the previous line?
I have the following file that contains some blank lines and some lines I would like to append to the previous line...
current file:
checking dsk c19t2d6
checking dsk c19t2d7
... (2 Replies)
Discussion started by: mr_manny
2 Replies
3. Shell Programming and Scripting
I seem to have gotten myself in over my head on this one. I need help combining lines together.
I have a text file containing 24,000 lines (exactly why I need awk) due to bad formatting it has separated the lines (ideally it should be 12,000 lines total).
Example of file:
... (2 Replies)
Discussion started by: blueheed
2 Replies
4. Shell Programming and Scripting
hey,
I want to combine every three lines in a file onto one i.e
old file:
82 67 32
62 58 39
29 47 58
27 34 50
27 35 69
38 58 70
new file:
82 67 32 62 58 39 29 47 58
27 34 50 27 25 69 38 58 70
At the moment I am using the following code:
gawk 'BEGIN {x=0} { if(x<3)... (14 Replies)
Discussion started by: sme
14 Replies
5. Shell Programming and Scripting
Here is the sample file:
646 STARTED Tue Dec 30 06:38:53 2008
Job DdCustXAddr_brad has been reset.
647 STARTED Tue Dec 30 06:38:54 2008
Starting Job DdCustXAddr_brad. (...)
704 STARTED Tue Dec 30 06:49:02 2008
Job DdCustXAddr_brad aborted.
I want to combine every non-numbered line... (4 Replies)
Discussion started by: mfavero
4 Replies
6. Shell Programming and Scripting
Hi,
I have a requirement like following:
I have input file like:
Question: 1 ----Multiple choice---
What is
your
favourite colour?
Options: a) red b) blue c) none of these
Question: 2 ---Multiple choice-----
In which month
did you join
your first job?
Options: a) Jan b) Feb c)... (11 Replies)
Discussion started by: ppatra
11 Replies
7. Shell Programming and Scripting
Hi Friends,
I have a file1.txt
1001 jkilo yrhfm
200056 jhdf rjhwjkrh
3+u8jk5h3 uru ehjk
1002 jkfhk hfjkd
2748395 fdjksfh hefjkh
3hdfk ejkh kjhjke
In the above if you see the firt charcter of each line mentioned in red has a pattern .
I need to create another file where , the... (6 Replies)
Discussion started by: i150371485
6 Replies
8. Shell Programming and Scripting
Hi,
I want to read a live log file line by line and considering those line which start from time stamp;
Below code I am using, which read line but throws an exception when comparing line that does not contain error code
tail -F /logs/COMMON-ERROR.log | while read myline; do... (2 Replies)
Discussion started by: ketanraut
2 Replies
9. Shell Programming and Scripting
Hi All,
I have a file which has the following sample lines
--
<Member name="Canada"
Currency="CAD"
--
<Member name="UK"
Currency="GBP"
--
<Member name="Switzerland"
Currency="CHF"
--
<Member name="Germany"
Currency="EUR"
-- (11 Replies)
Discussion started by: dev.devil.1983
11 Replies
10. UNIX for Beginners Questions & Answers
Hi
below is the input file snippet.
here i want that all the line which is coming after 1 shoud be in one line.
so for exanple if after 1 there is two lines which is starting with 2 should be combine in one line.
input file content
1,8091012,BATCH_1430903_01,21,T,2,808738,,,,21121:87:01,... (19 Replies)
Discussion started by: scriptor
19 Replies
LEARN ABOUT REDHAT
fb.modes
fb.modes(8) Linux frame buffer utils fb.modes(8)
NAME
fb.modes - frame buffer modes file
DESCRIPTION
/etc/fb.modes contains an unlimited number of video mode descriptions. The general format of a video mode is:
mode
geometry <xres> <yres> <vxres> <vyres> <depth>
timings <pixclock> <left> <right> <upper> <lower> <hslen> <vslen>
options <value>
endmode
OPTIONS
geometry options:
xres visible horizontal resolution (in pixels)
yres visible vertical resolution (in pixels)
vxres virtual horizontal resolution (in pixels)
vyres virtual vertical resolution (in pixels)
depth display depth (in bits per pixel)
timing options:
pixclock
length of one pixel (in picoseconds)
left left margin (in pixels)
right right margin (in pixels)
upper upper margin (in pixel lines)
lower lower margin (in pixel lines)
hslen horizontal sync length (in pixels)
vslen vertical sync length (in pixel lines)
other options:
the first value of this options is the default
hsync {low|high}
the horizontal sync polarity
vsync {low|high}
the vertical sync polarity
csync {low|high}
the composite sync polarity
extsync {false|true}
enable or disable external resync. If enabled the sync timings are not generated by the frame buffer device and must be pro-
vided externally instead. Note that this option may not be supported by every frame buffer device
laced {false|true}
enable or disable interlace. If enabled the display will be split in two frames, each frame contains only even and odd lines
respectively. These two frames will be displayed alternating, this way twice the lines can be displayed and the vertical fre-
quency for monitor stays the same, but the visible vertical frequency gets halved
double {false|true}
enable or disable doublescan. If enabled every line will be displayed twice and this way the horizontal frequency can easily
be doubled, so that the same resolution can be displayed on different monitors, even if the horizontal frequency specifica-
tion differs. Note that this option may not be supported by every frame buffer device
INTERNALS
Generally a frame buffer display is organized as follows:
+---+---------------+---+---+
| | ^ | | |
| | | 5 | | |
| | v | | |
+---#################---+---+
| # ^ # | |
| # | # | |
| # | # | |
| 1 # | 2 # 3 | 4 |
|<->#<------+------>#<->|<->|
| # | # | |
| # | 6 # | |
| # | # | |
| # v # | |
+---#################---+---+
| | ^ | | |
| | | 7 | | |
| | v | | |
+---+---------------+---+---+
| | ^ | | |
| | | 8 | | |
| | v | | |
+---+---------------+---+---+
1 left margin
2 xres
3 right margin
4 horizontal sync len
5 upper margin
6 yres
7 lower margin
8 vertical sync len
The area bordered with `#' is the visible display area. Horizontal and vertical frequencies can now easily be calculated, for this the sum
of horizontal or vertical values are important
htotal = left + xres + right + hslen
vtotal = upper + yres + lower + vslen
The length of one line can now be calculated with pixclock
line = pixclock * htotal
and we have the horizontal frequency
hfreq = 1E12 / line = 1E12 / (pixclock * htotal)
To get the vertical frequency vtotal must eventually adjusted. If the display is laced, vtotal must be halved or if the display is a dou-
blescan one, vtotal must be doubled. Now we can calculate the length of one frame
if (lace) vtotal /= 2
if (double) vtotal *= 2
frame = vtotal * line
and we get also the vertical frequency
vfreq = 1E12 / frame = hfreq / vtotal
SEE ALSO
fbset(8), fbdev(4)
local Aug 1996 fb.modes(8)