Assuming that you have files item_at_position[789].list containing valid values for each of those fields (one value per line), such as: item_at_position7.list: item_at_position8.list:
and item_at_position9.list:
and an input file (Input1.txt) containing:
then the following awk script:
prints the following diagnostic to the standard error output:
and stores the following output in Output.txt:
and, with your original sample input file, stores the foliowing output in Output.txt:
without producing any diagnostic messages.
Is this what you wanted to do?
If you want to try this on a Solaris/SunOS system, use /usr/xpg4/bin/awk, /usr/xpg6/bin/awk, or nawk instead of the default /usr/bin/awk.
This User Gave Thanks to Don Cragun For This Post:
Hi All,
I have a file with following list.
example 1
========
cat 1.txt
--------
0000cab4752c
0000dab47c2c
...
...
...
Also i have another file 2.txt in which the data is in this format as shown:
cat 2.txt
---------... (6 Replies)
Hi,
I have two files. file1 contents:
aaa bbb ccc ddd
eee fff ggg ddd
www eee ggg dde
qqq zzz hhh ddd
file2 contents:
mmm
mmm
mmm
mmm
Now I want to add file2 contents to end of lines in file1 where a line contains pattern "ddd" and it should look like this:
file3 contents:
aaa... (3 Replies)
Hi there, i have an /etc/hosts file that is organised in sections, like this
#
# Oracle Servers
#
1.1.1.1 boxa
2.2.2.2 boxb
9.9.9.9 boxj
#
# Prod Sybase Servers
#
6.6.6.6 boxt
4.4.4.4 boxz
I am just trying to write a line of code that will ill be able to pass the comment block... (3 Replies)
Hi All,
I have the Overview.csv file like below format
Message ID Sendout Group Name Email Subject Name Type Rcpts Responses Response Rate Open Rate Click Rate
2000009723 01-22-2014 16:14 Test_GroupPQA2013 000123@yahoo.com INFO RISQUE D'INONDATION... (3 Replies)
Hi,
Now I have: /Users/okn/bin for my private shell scripts.
How do I add /Users/okn/bin to my PATH?
The PATH is right now:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
The .bash_profile doesn't state anything about a PATH (yet).
I read about this:
PATH=/bin:$PATH
export PATH
or... (1 Reply)
I have a file
cat /root/file
#import node1
#import node2
import node2
import node4
After sed/awk operation the file should be as follows
cat /root/file
#import node1
#import node2
#import node2
#import node4 (6 Replies)
Hi there,
I am new to Unix and had below requirement to finish my task.
I have file1.dat which has data as shown below.
case1.txt
case2.txt
case3.txt
case4.txt
file1.dat has only file names
I have folder which has above files mentioned in file1.dat
./all_files
case1.txt... (6 Replies)
Hello,
I am searching the following string Folder^ in a file and replacing it with Folder^/
However if the file already contains Folder^/ I want to avoid replacing it with Folder^//
To do this I have to do the following today:
1) echo "Folder^" | sed 's/Folder\^/Folder\^\//g'
I get... (2 Replies)