Sponsored Content
Full Discussion: Grep -f for big files
Top Forums UNIX for Beginners Questions & Answers Grep -f for big files Post 303035741 by ahfze on Saturday 1st of June 2019 04:13:34 PM
Old 06-01-2019
hi guys.
ok so im working with a huge pattern file Q.
i am trying to split the pattern file Q into 50 files and saving output of grep in file1,file2...etc
the problem is that the output keeps saving in file0.its not saving in file1,file2 etc
can someone help?

i wrote these codes.
Code:
let i=0
while read line; do
split -l 50 Q Q.split.
for CHUNK in Q.split.* ; do
        grep -f "$CHUNK" MEGA-CNN-AND-LINKDIN >"file_$i"
  let i+=1
done < "$i"
  done 
done

 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Archiving big ammount of files.

Hello All. I have problem archiving files. The problem is:) I have about 10000 files in one directory, all this file aproximately the same size, i need to gzip them and write on DVD. But all this files take about 15 GB of space (already gzipped). So i need DVD Blue-Ray :p or i need to split... (3 Replies)
Discussion started by: Maxeg
3 Replies

2. Shell Programming and Scripting

Big data file - sed/grep/awk?

Morning guys. Another day another question. :rolleyes: I am knocking up a script to pull some data from a file. The problem is the file is very big (up to 1 gig in size), so this solution: for results in `grep "^\ ... works, but takes ages (we're talking minutes) to run. The data is held... (8 Replies)
Discussion started by: dlam
8 Replies

3. Shell Programming and Scripting

sed of big html files

hi friends, i have to cut a large html file between tag " <!-- DEFACEMENTS ROWS -->" "<!-- DISCLAIMER FOOTER -->" and store cut data in other file please help me!!!! (2 Replies)
Discussion started by: praneshbmishra
2 Replies

4. Shell Programming and Scripting

awk with really big files

Hi, I have a text file that is around 7Gb which is basically a matrix of numbers (FS is a space and RS is \n). I need the most efficient way of plucking out a number from a specified row and column in the file. For example, for the value at row 15983, col 26332, I'm currently I'm using: ... (1 Reply)
Discussion started by: Jonny2Vests
1 Replies

5. Linux

Strings does not work for big files

I was trying to calculate DBID of oracle database according to the topic Oracle in World: How to Discover find DBID and following number 2) mechanism specified there that is using of strings keyword. My unfortunately my oracle database datafile is so big that I could not use strings keyword for... (1 Reply)
Discussion started by: synthea
1 Replies

6. UNIX for Advanced & Expert Users

Split a big file into two others files

Hello, i have a very big file that has more then 80 MBytes (100MBytes). So with my CVS Application I cannot commit this file (too Big) because it must have < 80 MBytes. How can I split this file into two others files, i think the AIX Unix command : split -b can do that, buit how is the right... (2 Replies)
Discussion started by: steiner
2 Replies

7. UNIX for Dummies Questions & Answers

Copy Files From a big list

Requirement: When I do ls -ltr /home/data/orders I get a huge list of files, I need to copy that last 50 to another directory say /home/work/ later, I will do my ETL process and then again I need to copy from 51 to 100 and so on. What is the command to copy files specifying 1 to 50... (5 Replies)
Discussion started by: eskay
5 Replies

8. UNIX for Advanced & Expert Users

Need help for faster file read and grep in big files

I have a very big input file <inputFile1.txt> which has list of mobile no inputFile1.txt 3434343 3434323 0970978 85233 ... around 1 million records i have another file as inputFile2.txt which has some log detail big file inputFile2.txt afjhjdhfkjdhfkd df h8983 3434343 | 3483 | myout1 |... (3 Replies)
Discussion started by: reldb
3 Replies
XZDIFF(1)							     XZ Utils								 XZDIFF(1)

NAME
xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files SYNOPSIS
xzcmp [cmp_options] file1 [file2] xzdiff [diff_options] file1 [file2] lzcmp [cmp_options] file1 [file2] lzdiff [diff_options] file1 [file2] DESCRIPTION
xzcmp and xdiff invoke cmp(1) or diff(1) on files compressed with xz(1), lzma(1), gzip(1), or bzip2(1). All options specified are passed directly to cmp or diff. If only one file is specified, then the files compared are file1 (which must have a suffix of a supported com- pression format) and file1 from which the compression format suffix has been stripped. If two files are specified, then they are uncom- pressed if necessary and fed to cmp(1) or diff(1). The exit status from cmp or diff is preserved. The names lzcmp and lzdiff are provided for backward compatibility with LZMA Utils. SEE ALSO
cmp(1), diff(1), xz(1), gzip(1), bzip2(1), zdiff(1) BUGS
Messages from the cmp(1) or diff(1) programs refer to temporary filenames instead of those specified. Tukaani 2009-07-05 XZDIFF(1)
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy