01-14-2011
Find line number of bad data in large file
Hi Forum.
I was trying to search the following scenario on the forum but was not able to.
Let's say that I have a very large file that has some bad data in it (for ex: 0.0015 in the 12th column) and I would like to find the line number and remove that particular line.
What's the easiest way to do so?
For a smaller file, I could use the "vi editor", edit the file, search for the bad data in the specific column and then just delete the row.
But for a larger file where using the "vi editor" is out of the question.
Cannot really use the grep -v "0.0015" option since "0.0015" value could be valid for other rows and which is not in the 12th column.
I do not know what is the line number where the bad data resides.
Thanks.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all;
I'm having a problem when want to list a large number of files in current directory using find together with the prune option.
First i used this command but it list all the files including those in sub directories:
find . -name "*.dat" | xargs ls -ltr
Then i modified the command... (2 Replies)
Discussion started by: ashikin_8119
2 Replies
2. Shell Programming and Scripting
Hi Everybody,
I am trying to write a script that will get some perticuler data from a file and redirect to a file.
My Question is,
I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line.
I know the line numbers, I need to get all... (9 Replies)
Discussion started by: Anji
9 Replies
3. Solaris
System Solaris 8
When I open a CONSOLE window the following starts scrolling:
"ServiceCommand: :write: Bad FIle Number"
This will continue to scroll without stopping. However, you can type while it is scrolling and login into root and even conduct business within the CONSOLE window. The... (1 Reply)
Discussion started by: Kevin1166
1 Replies
4. Programming
Hi All,
I don't need any code for this just some advice. I have a large collection of heterogeneous data (about 1.3 million) which simply means data of different types like float, long double, string, ints. I have built a linked list for it and stored all the different data types in a structure,... (5 Replies)
Discussion started by: shoaibjameel123
5 Replies
5. Shell Programming and Scripting
Hi All,
I have searched this forum for related posts but could not find one that fits mine. I have a shell script which removes all the XML tags including the text inside the tags from some 4 million XML files.
The shell script looks like this (MODIFIED):
find . "*.xml" -print | while read... (6 Replies)
Discussion started by: shoaibjameel123
6 Replies
6. Shell Programming and Scripting
Hi
I have requirement to find nth occurrence in a file and capture data from with in lines (between lines)
Data in File.
<QUOTE>
<SESSION>
<ATTRIBUTE NAME='Parameter Filename' VALUE='file1.parm'/>
<ATTRIBUTE NAME='Service Name' VALUE='None'/>
</SESSION>
<SESSION>
<ATTRIBUTE... (6 Replies)
Discussion started by: tmalik79
6 Replies
7. Shell Programming and Scripting
Hello. I was wondering if anyone could help. I have a file containing a large table in the format:
marker1 marker2 marker3 marker4
position1 position2 position3 position4
genotype1 genotype2 genotype3 genotype4
with marker being a name, position a numeric... (2 Replies)
Discussion started by: davegen
2 Replies
8. Shell Programming and Scripting
Hi
I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field.
The source file is pipe delimited and looks something like
1|net|ABC Letr1|1530|||
1|net|EXP_1040 ABC|1121|||
1|net|EXP_TG1224|1122|||
1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies
9. Shell Programming and Scripting
Hi i have some large data files that contain several fields and rows the data in a field have a numeric value that is in a sine wave pattern what i would like todo is locate each peak and pick the highest value and print that complete line. the data looks something like this it is field nr4 which... (4 Replies)
Discussion started by: ninjaunx
4 Replies
10. Shell Programming and Scripting
I have a .csv file that has been create from a google form and I need to extract the data from it that has been entered by users.
The CSV will have anywhere between 100 and 1000 lines which comprise entr data for a sports carnival
A few typical line is shown here to show the problem I have
... (19 Replies)
Discussion started by: kcpoole
19 Replies
CQTEST(8C) CQTEST(8C)
NAME
cqtest - HylaFAX copy quality checking test program
SYNOPSIS
/usr/sbin/cqtest [ options ] input.tif
DESCRIPTION
cqtest is a program for testing the copy quality checking support in the HylaFAX software (specifically, in the faxgetty(8C) program).
cqtest takes a TIFF/F (TIFF Class F) file and generates a new TIFF/F file that is a copy of the input file, but with any erroneous scan-
lines replaced/regenerated. In addition, cqtest prints diagnostic messages describing its actions and indicates whether the input data has
acceptable copy quality according to the copy quality checking threshold parameters. Options are provided for specifying copy quality
checking threshold parameters
OPTIONS
-m badlines Set the maximum consecutive bad lines of data that may appear in each acceptable page of input data. This is equivalent to
the MaxConsecutiveBadLines configuration parameter; c.f. hylafax-config(5F). By default cqtest accepts no more than 5 con-
secutive bad lines in a page.
-o file Write output to file. By default output is written to the file cq.tif.
-p %goodlines Set the minimum percentage of ``good lines'' of data that may appear in acceptable page of input data. A line is good if it
decodes without error to a row of pixels that is the expected width. This is equivalent to the PercentGoodLines configura-
tion parameter; c.f. hylafax-config(5F). By default cqtest requires that 95% of the rows of each page be good.
EXAMPLES
The following shows a multi-page, high-resolution document with a single error on each page. Each page has acceptable copy quality using
the default threshold parameters.
hyla% /usr/sbin/cqtest ~/tiff/pics/faxix.tif
1728 x 297, 7.7 line/mm, 1-D MH, lsb-to-msb
RECV/CQ: Bad 1D pixel count, row 245, got 1616, expected 1728
RECV: 2234 total lines, 1 bad lines, 1 consecutive bad lines
1728 x 297, 7.7 line/mm, 1-D MH, lsb-to-msb
RECV/CQ: Bad 1D pixel count, row 148, got 3023, expected 1728
RECV: 2234 total lines, 1 bad lines, 1 consecutive bad lines
1728 x 297, 7.7 line/mm, 1-D MH, lsb-to-msb
RECV/CQ: Bad 1D pixel count, row 151, got 1722, expected 1728
RECV: 2234 total lines, 1 bad lines, 1 consecutive bad lines
1728 x 297, 7.7 line/mm, 1-D MH, lsb-to-msb
RECV/CQ: Bad 1D pixel count, row 148, got 1776, expected 1728
RECV: 2234 total lines, 1 bad lines, 1 consecutive bad lines
SEE ALSO
faxgetty(8C), hylafax-config(5F)
October 3, 1995 CQTEST(8C)