Sponsored Content
Top Forums Shell Programming and Scripting Extracting/condensing text from multiple files to multiples files Post 302520167 by ctsgnb on Friday 6th of May 2011 03:42:51 AM
Old 05-06-2011
Code:
for i in list*.text
do
grep Apples "$i" > ${i%.*}apples.txt
done

This User Gave Thanks to ctsgnb For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Extracting the required text from log files

It would be highly appreciable if any one helps me in this. I am trying to get it done through Java but I love unix and believe it can be done within minutes with couple of lines. The input log file is a text file contains multiple entries seperated by a blank line. Each seperated entry... (7 Replies)
Discussion started by: hareeshram
7 Replies

2. UNIX for Advanced & Expert Users

Extracting files with multiple links-perl

i want to write a perl script that gets/displays all those files having multiple links (in current directory) (4 Replies)
Discussion started by: guptesanket
4 Replies

3. UNIX for Dummies Questions & Answers

Extracting columns from multiple files with awk

hi everyone! I already posted it in scripts, I'm sorry, it's doubled I'd like to extract a single column from 5 different files and put them together in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is: awk 'NR==FNR{a=$2; next}... (1 Reply)
Discussion started by: orcaja
1 Replies

4. Shell Programming and Scripting

Extracting columns from multiple files with awk

hi everyone! I'd like to extract a single column from 5 different files and put them together in an output file. I saw a similar question for 2 input files, and the line of code workd very well, the code is: awk 'NR==FNR{a=$2; next} {print a, $2}' file1 file2 I added the file3, file4 and... (10 Replies)
Discussion started by: orcaja
10 Replies

5. Shell Programming and Scripting

matching and extracting info from text files

Hi all, I have two .txt file i.e. First text file: 2 4 1 4 Second text file 2 1.nii.gz 4 334.nii.gz 1 12.nii.gz 4 134.nii.gz If entry in 1st column of 1st text file matches the 1st column of 2nd text file, then copy the file (name of which is the second column) associated with... (4 Replies)
Discussion started by: vd24
4 Replies

6. Programming

extracting text files

i m unable to extract data from one text files to different text files..i am able to concat two text files in d same file ---------- Post updated at 03:21 PM ---------- Previous update was at 03:16 PM ---------- i want a c program for it (2 Replies)
Discussion started by: asd123
2 Replies

7. Shell Programming and Scripting

extracting information from multiple files

Hello there, I am trying to extract (string) information ( a list words) from 4 files and then put the results into 1 file. Currently I am doing this using grep -f list.txt file1 . and repeat the process for the other 3 files. The reasons i am doing that (a) I do know how to code (b) each file... (4 Replies)
Discussion started by: houkto
4 Replies

8. Shell Programming and Scripting

Extracting non multiple files via script

Hi, Can somebody help me? I am testing a demo with the given function PATH525="/uscms/home/emily/READme/extra/data/" TEMP=temp FileName=DataFileName CopyFiles() { # PATHNAME="$paths" ... (9 Replies)
Discussion started by: emily
9 Replies

9. Shell Programming and Scripting

Extracting specific files from multiple .tgz files

Hey, I have number of .tgz files and want to extract the file with the ending *results.txt from each one. I have tried for file in *.tgz; do tar --wildcards -zxf $file *results.txt; doneas well as list=$(ls *.tgz) for i in $list; do tar --wildcards -zxvf $i *.results.txt; done... (1 Reply)
Discussion started by: jfern
1 Replies

10. Shell Programming and Scripting

Extracting values based on line-column numbers from multiple text files

Dear All, I have to solve the following problems with multiple tab-separated text file but I don't know how. Any help would be greatly appreciated. I have access to Linux mint (but not as a professional). I have multiple tab-delimited files with the following structure: file1: 1 44 2 ... (5 Replies)
Discussion started by: Bastami
5 Replies
nomarch(1)							Archive Extraction							nomarch(1)

NAME
nomarch - extract `.arc' archives SYNOPSIS
nomarch [-hlptUv] [archive.arc] [match1 [match2 ... ]] DESCRIPTION
nomarch lists, extracts, or tests `.arc' archives. (An alternate extension sometimes used was `.ark'; these work too.) This is a very out- dated file format which should certainly not be used for anything new, but you may still need an extraction utility, and here it is. :-) The default action is to extract all files in the specified archive; see OPTIONS below for how to do other things instead. OPTIONS
-h give terse usage help. -l list files in archive. If verbose listings are enabled, it shows the filename, compression method, compressed/uncompressed size, date/time, and CRC; but by default, it just shows the filename, uncompressed size, and date/time. -p extract to standard output, rather than to separate files. -t test files in archive (more precisely, check file CRCs). -U use uppercase filenames; more precisely, preserve original case from archive. -v give verbose output (when used with `-l'). archive.arc the archive to operate on. match1 etc. optionally specify which archive members to list/extract/test. Those which match any of these filenames/wildcards are processed. Wildcard operators supported are shell-like `*' and `?', but don't forget to quote arguments which use these (e.g. `nomarch foo.arc '*.bar''). EXTRACTING MULTIPLE ARCHIVES
nomarch follows the `unzip'-like practice of working on only one archive per run, with further `filenames' given on the command-line actu- ally specifying files to extract (or whatever). The easiest way to work on multiple files with nomarch is simply to run it multiple times using for; for example: for i in *.arc; do nomarch $i; done The above would extract all archives in the current directory. USING THE PROGRAM FROM EMACS
Emacs's arc-mode facility lets you work with various kinds of archive file directly from the editor. Making it use nomarch for extracting `.arc' files isn't too hard. Just add the following to your ~/.emacs file: (setq archive-arc-extract '("nomarch" "-U")) BUGS
The CRC used by the format is only 16-bit, so `-t' is a less-than-perfect test. One compression method, obsolete even by `.arc' standards :-), isn't supported yet. This is partly because I've yet to find a single file which uses it, despite testing an awful lot of files. Subdirectories in Spark archives are extracted as the `.arc'-format files they really are, which may not be terribly convenient. SEE ALSO
tar(1), gzip(1), bzip2(1), lbrate(1) AUTHOR
Russell Marks (rus@svgalib.org). Version 1.4 18th June, 2006 nomarch(1)
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy