Sponsored Content
Top Forums UNIX for Dummies Questions & Answers using 'cat' to in 'while read line' Post 96205 by chugger06 on Wednesday 18th of January 2006 01:18:50 PM
Old 01-18-2006
ANDing 2 files

Hi,
Thanks for replying. That wa at least part of my problem as so obvious!!
filename contains a list of file names with different extensions. i just want files with a particular extension, 'stuff' in the example to do processing on. itmust have been looping infinitely.

thanks heaps. do you have suggestions for comparing the contents of two very similar files, when i need to be able to output a true/false value against a particular line? it's like an AND operation, with 2 different sets, not the same size.

is bash enough, or would perl be better? Thans again for helping.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cat and read command

Here's what the shell (korn) script is doing: 1. Prompt for input 2. Read a file using the cat and the while read command. 3. Get a field on the record and hold that value in a variable. 4. Within the process, I then need to prompt the user again to ask them if they are sure they want to make... (3 Replies)
Discussion started by: mango
3 Replies

2. Shell Programming and Scripting

Cat'ing a multiple line file to one line

I am writing a script that is running a loop on one file to obtain records from another file. Using egrep, I am finding matching records in file b, then outputing feilds of both into another file. **************************** filea=this.txt fileb=that.txt cat $filea | while read line do... (1 Reply)
Discussion started by: djsal
1 Replies

3. Shell Programming and Scripting

cat file1 read line-per-line then grep -A 15 lines down in fileb

STEP 1 # Set variable FILE=/tmp/mainfile SEARCHFILE =/tmp/searchfile # THIS IS THE MAIN FILE. cat /tmp/mainfile Interface Ethernet0/0 "outside", is up, line protocol is up Hardware is i82546GB rev03, BW 100 Mbps Full-Duplex(Full-duplex), 100 Mbps(100 Mbps) MAC address... (6 Replies)
Discussion started by: irongeekio
6 Replies

4. Shell Programming and Scripting

cat in the command line doesn't match cat in the script

Hello, So I sorted my file as I was supposed to: sort -n -r -k 2 -k 1 file1 | uniq > file2 and when I wrote > cat file2 in the command line, I got what I was expecting, but in the script itself ... sort -n -r -k 2 -k 1 averages | uniq > temp cat file2 It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies

5. Shell Programming and Scripting

help using read in menu script to cat out lines in logs

What is wrong with my menu script? Do I need to continue with the read statements? All I want to do with option 4 is to cat some /var/log/files and awk out a few lines? How do I do that please? $ cat menu.sh ... (11 Replies)
Discussion started by: taekwondo
11 Replies

6. Shell Programming and Scripting

Read files, lines into array, cat vs open

Hi Everyone, I have a file: a.txt a,b,c,d,6,6,6 1,2,3,d,6,6,6 4,5,6,6,6,6,6 #!/usr/bin/perl use warnings; use strict; my @array = (); ### Load file into array for my $i (split '\n', `cat /tmp/a.txt`) { push @array, ; } It works. But my a.txt have 1million lines, and... (2 Replies)
Discussion started by: jimmy_y
2 Replies

7. Shell Programming and Scripting

bash: read file line by line (lines have '\0') - not full line has read???

I am using the while-loop to read a file. The file has lines with null-terminated strings (words, actually.) What I have by that reading - just a first word up to '\0'! I need to have whole string up to 'new line' - (LF, 10#10, 16#A) What I am doing wrong? #make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies

8. Shell Programming and Scripting

How can I read variable text files through cat command?

Hi. I'm just wondering how can I read variable text files through cat command. I made a shell script to count frequency of words and array them with variable conditions. It's only working for one file that I wrote in script now. But I want to make it working for every text file when I execute... (2 Replies)
Discussion started by: rlaxodus
2 Replies

9. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

10. Solaris

Not able read data with cat command

I am trying to read some data form .key file with cat command..but its not displaying data correctly..tried with other commands also still no use.i tried with CAT with SED combination but no use.. Please help me with the command or script. (10 Replies)
Discussion started by: kish_rock
10 Replies
cavern(1)						      General Commands Manual							 cavern(1)

NAME
cavern -- process raw survey data SYNOPSIS
cavern [options] survex data file Description Cavern is the Survex data processing engine. If multiple survey data files are listed on the command line, they are processed in order from left to right. Settings are reset to their defaults before processing each file. Options -p, --percentage You can get cavern to display the percentage progress through the current file. As of Survex 0.90 this is disabled by default, but you can enable it if you want. Because the value given is for the current file, the values jump around for a multi-file sur- vey project. Also note that displaying this information slows down processing a little. -o, --output=OUTPUT Sets location for output files. -q, --quiet Only show a brief summary (--quiet --quiet or -qq will display warnings and errors only). -s, --no-auxiliary-files do not create .err file. -w, --warnings-are-errors turn warnings into errors. --log Send screen output to a .log file. Output Cavern reads in text files containing the survey data .svx) and outputs two files, with the extensions .3d and .err. By default these files are put in the current directory, with the same base filename as the first .svx file read, but a different extension. You can change the directory and/or base filename using the --output command line option. E.g. if you process the data file entrance.svx with the command cavern entrance entrance.3d and entrance.err will be created. Cavern also gives a range of statistics at the end of a successful run: o The highest and lowest stations and the height difference between them o The total length of the survey (before and after adjustment). This total excludes survey legs flagged as SURFACE, DUPLICATE, or SPLAY. o The number of stations and legs. Note that a *EQUATE is counted as a leg in this statistic. o The East-West and North-South ranges, and the North-most, South-most, East-most, and West-most stations. o The number of each size of node in the network (where size is number of connections to a station) i.e. a one node is the end of a dead-end traverse, a two-node is a typical station in the middle of a traverse, a three-node is a T-junction etc. o How long the processing took and how much CPU time was used. .3d - data describing the loop-closed centre line This file contains details of the stations and legs, and any flags associated with them. .err - loop closure statistics (%age errors, etc) This file contains statistics about each traverse in the survey which is part of a loop. It includes various statistics for each traverse, such as the percentage error per leg. You should study this information to determine if any parts of the survey are of lower quality or contain gross errors. Error Messages There are a number of error messages that you may get when processing data. Most of these are self explanatory, and will be caused by such problems as typing mistakes, or by your survey data not being attached to fixed points (in this situation, Survex will list some of the stations that are not connected). Along with the error message, the filename and line number of the offending line will be printed (or the filename for errors such as `file not found'). The format of the filename and line number is that used by gcc, so if your editor can parse errors from gcc, you should be able to set it to allow you to jump to the file and line of each error. Cavern will stop after more than 50 errors. This usually indicates something like the incorrect data order being specified. Deluging the user with error messages makes the actual problem less clear. See Also 3dtopos(1), aven(1), cad3d(1), diffpos(1), extend(1), sorterr(1), svxedit(1) cavern(1)
All times are GMT -4. The time now is 02:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy