It's complicated to do this in one awk command with many arrays, it's more clarifying to split this in more steps:
Thank you for your idea! Really it is not necessary to be a one-liner... just need something simple.
So far I was trying something like this:
Code:
while read field1; do
B2='cat fileB | nawk -v fi=$field1 '{ if ( $1 == fi ) print $2 }''
C2='cat fileC | nawk -v fi=$B2 ' { if ( $2 == fi ) print $1 }''
D2='cat fileD | nawk -v fi=$C2 ' { if ( $2 == fi ) print $1 }''
echo "$field1 $B2 $C2 $D2" >> output
done < fileA
(may not be actual commands, typing from memory)
but something was broken... and I had to sleep, so I'll go back at it again today. Anyway, this is not very good as it will parse all files several times, one for each record in fileA.
Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .
Hi I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.
I want to create a mutiple output files with each file having a... (2 Replies)
Hi,
i have 2 input files which are file1.txt and file2.txt. I need to extract data from file1.txt and file2.txt and save it in file3.txt like example below:-
File1.txt
ID scrap1
Name scrap1
start 1
end 10
ID scrap2
Name scrap2
start 11
end ... (4 Replies)
Hi,
I'm working on a script which has to copy multiple files from one server to another server. The list of files that are to be copied is present in a file say input.txt.
vi input.txt
abc.c
welcome.c
new.c
welcome1.c
for ftp'ing a single file say 'new.c' the following code... (2 Replies)
Hi!
I'm new in awk and I need some help.
I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files.
Thanks in advance for help!
:-)
ciao (5 Replies)
The following code will split the infile into multiple files. However, I need it to insert the same first 3 lines from the original input file into each splitted file. How do I modify my script below to do so:
print -n "Enter file name to split? " ; read infile
if
then
echo "Invalid file... (4 Replies)
I have a environment property file which contains:
Input file:
value1 = url1
value2 = url2
value3 = url3 and so on.
I need to search all *.xml files under directory for value1 and replace it with url1.
Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Hi,
I have many test*.ft1 files to which I want to read as input for a script called
pipe2txt.tcl and print the output in each separate file.
For example,
pipe2txt.tcl < test001.ft1 > test001.txt
How can I read many files in this maner?
thank you very much,
Best,
Pahuja (5 Replies)
Hi!
I am looking to build dynamic menu (named: lookup.sh) that reads a pipe delimited file for input.
for example, contents of input.txt could be:
user1|srv1
user3|srv1
user4|srv1
user2|srv2
I want the menu look like:
1) get password for user1 on srv1
2) get password for user3 on... (7 Replies)
Discussion started by: cpolikowsky
7 Replies
LEARN ABOUT FREEBSD
pnmsplit
pnmsplit(1) General Commands Manual pnmsplit(1)NAME
pnmsplit - split a multi-image portable anymap into multiple single-image files
SYNOPSIS
pnmsplit [pnmfile[ output_file_pattern]]
DESCRIPTION
Reads a Netpbm file as input. Copies each image in the input into a separate file, in the same format.
pnmfile is the file specification of the input file, or - to indicate Standard Input. The default is Standard Input.
output_file_pattern tells how to name the output files. It is the file specification of the output file, except that the first occurence
of "%d" in it is replaced by the image sequence number in unpadded ASCII decimal, with the sequence starting at 0. If there is no "%d" in
the pattern, pnmsplit fails.
The default output file pattern is "image%d".
Note that to do the reverse operation (combining multiple single-image PNM files into a multi-image one), there is no special Netpbm pro-
gram. Just use cat.
SEE ALSO pnm(5), cat(1)AUTHOR
Written by Bryan Henderson
19 June 2000 pnmsplit(1)