I am reading in a file in a Korn shell script. The file has one header row followed by possibly millions of data rows. I want to do one thing to the header row and write it out to a new output file, then something different to the data rows. My code looks like this:
But when I do this the while loop reads the first line in again - so I get the header line twice. The pointer goes back to the start of the file, or it closes and reopens, not sure what is going on. I know I could put the header logic in the while loop and just test for the first line and do that coding there. But I'd rather not have to do that test millions of times when I know I only need to process the first line differently. Why does the file reader not move to the next line? I assume the "done < $infile" part is forcing it to start at the beginning again. Anyway to make this work this way?
Hi,
In a shell script I am makin use of 3 files f1,f2 and f3.txt.
When the Unix server is restarted I want to delete all these 3
files if they are existing.
( I suppose I will have to use this command
rm /thefilepath/f*
but dont know in which script to use.)
Anyone knows what can be... (6 Replies)
I need a command which filters rows ONLY NOT beginning with '*'
So far I have following NOT sufficient command, because it does not include ALL possible literals except of '*'
grep ^ INPUT_FILE >>OUTPUT_FILE
Is it possible to write something like
grep NOT ^
INPUT_FILE... (3 Replies)
Hello. I have the following issue: my txt file has the following format:
train/dr4/fklc0/sx175.txt
0 80282 Severe myopia contributed to Ron's inferiority complex.
train/dr4/fklc0/sx355.txt
0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt
awk 'NR%2==0' test1.txt >... (4 Replies)
Hello. I have the following issue: my txt file has the following format:
train/dr4/fklc0/sx175.txt 0 80282 Severe myopia contributed to Ron's inferiority complex. train/dr4/fklc0/sx355.txt 0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt
With the... (1 Reply)
Hi All,
I recently downloaded the Linux kernel source code, added them all to a project in MS VC++ and plan to read through it so that I can improve the way I code, read/understand a large code database and hopefully contribute something to the development of the Linux OS.
I have taken a... (3 Replies)
Hi Folks,
I am again here with a peculier problem.
Please see the code
root@celdws01: # sar -u -f /var/adm/sa/sa21
SunOS celdws01 5.9 Generic_118558-34 sun4u 12/21/2011
10:10:09 %usr %sys %wio %idle
10:10:09 unix restarts
Can anyone help me in... (9 Replies)
Hi,
I am facing issues with the below:
I have a lookup file say lookup.lkp.This lookup.lkp file contains strings delimited by comma(,).
Now i want to read this command from file and execute it.
So my code below is :
Contents in the lookup.lkp file is :
c_e,m,a,`cd $BOX | ls cef_*|tail... (7 Replies)
Hi
I have jobs (some 1000) defined in a file and I want to read those jobs and run a a command.
For example:
jobs.txt
abc
efg
I want to read the entire file and run the following command
Delete -JOB "abc"
Deleteing abc...
Delete -JOB "efg"
Delete efg...
Can somebody help me... (4 Replies)
hi
when i am trying to check the file size using du command in shell script but getting a below error, although the file is present
du: cannot access `LOGS_18-08-20.tar.gz': No such file or directory
below is snippet of script
cd /home
dt=$(date --date="yesterday" +"%y-%m-%d")
du ... (3 Replies)
Discussion started by: scriptor
3 Replies
LEARN ABOUT DEBIAN
dxf2vrml
DIME(1) General Commands Manual DIME(1)NAME
dxf2vrml - program to convert .dxf formatted 3-D datasets to .VRML format.
SYNOPSIS
dxf2vrml [infile][-ooutfile][-emaxerr][-f][-l]
DESCRIPTION
This manual page documents briefly the dxf2vrml command. (default infile is stdin, default outfile is stdout) This manual page was written
for the Debian GNU/Linux distribution because the original program does not have a manual page. Instead, it has documentation in the GNU
Info format; see below.
dxf2vrml is a program that...
OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is
included below. For a complete description, see the Info files.
infile default infile is stdin
-o outfile,
default outfile is stdout
-e, Maximum error when tessellating curves
-f, Respect the $FILLMODE header variable
-vrml2,
Write as vrml2. Default is vrml1
-l, Use layer color, ignore the color index
-s, Set sub parameter
-h, Show useage.
SEE ALSO
files in: /usr/share/doc/libdime/, /usr/share/doc/libdime-dev/.
The programs are documented fully by http://www.coin3d.org/lib/dime/, available via the Internet.
AUTHOR
This manual page was written by A. Maitland Bottoms <bottoms@debian.org>, for the Debian GNU/Linux system (but may be used by others).
January 11, 2002 DIME(1)