using awk to substitute data in a column delimited text file
hello i would like to use awk to do the following calculation from the following snippet.
input file
C;2390 ;CV BOUILLOTTE 2L 2FACES NERVUREES ;1.00 ;3552612239004;13417 ;25 ;50 ; 12;50000 ; ; ... (3 Replies)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Hi All,
I have the requirement in unix shell script.
I want to write the "ls -ltr" command out put to excel file as below.
Input :text file data :
drwxr-xr-x 5 root root 4096 Oct 2 12:26
drwxr-xr-x 2 apx aim 4096 Nov 29 18:40
drwxr-xr-x 5 root root 4096 Oct 2 12:26
drwxr-xr-x... (10 Replies)
Hi Guys,
I wanted to compare a delimited file and positional file, for a particular key files and if it matches then append the positional file with some data.
Example:
Delimited File
--------------
Byer;Amy;NONE1;A5218257;E5218257
Byer;Amy;NONE1;A5218260;E5218260
Positional File... (3 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
I am working on an outage script and I run a command from the command line which tells me the amount of generator failures in my market. The output of this command only gives me three digits to identify the site by. I have a master list of all sites in a separate file, call it list.txt. If my... (7 Replies)
Hi everyone..
I have a list of values in a file...
a,
b,
c,
1,
2,
3,
aaaa,
bbbbb,
I am interested in converting this column to a row..
"text",aaaa,
bbbb
a,1 (7 Replies)
"Debain 9 - LXDE"
I execute follow line in the bash terminal:
/ts3/server/ts3server_startscript.sh start createinifile=1 | tee -a /ts3/server/key.txt
The displayed output looks like follow:
My key.txt file looks like follow:
How can i save the whole displayed text in my file?
Why does... (5 Replies)
Discussion started by: int3g3r
5 Replies
LEARN ABOUT OSF1
comm
comm(1) General Commands Manual comm(1)NAME
comm - Compares two sorted files.
SYNOPSIS
comm [-123] file1 file2
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
command: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
Suppresses output of the first column (lines in file1 only). Suppresses output of the second column (lines in file2 only). Suppresses
output of the third column (lines common to file1 and file2).
The command comm -123 produces no output.
OPERANDS
A pathname of the first file to be compared. If file1 is a hyphen (-), the standard input is used. A pathname of the second file to be
compared. If file2 is a hyphen (-), the standard input is used.
If both file1 and file2 refer to standard input or to the same FIFO special, block special or character special file, the results are unde-
fined.
DESCRIPTION
The comm command reads file1 and file2 and writes three columns to standard output, showing which lines are common to the files and which
are unique to each.
The leftmost column of standard output includes lines that are in file1 only. The middle column includes lines that are in file2 only.
The rightmost column includes lines that are in both file1 and file2.
If you specify a hyphen (-) in place of one of the file names, comm reads standard input.
Generally, file1 and file2 should be sorted according to the collating sequence specified by the LC_COLLATE environment variable. (See
sort(1).) If the input files are not sorted properly, the output of comm might not be useful.
EXIT STATUS
Successful completion. Error occurred.
EXAMPLES
In the following examples, file1 contains the following sorted list of North American cities:
Anaheim Baltimore Boston Chicago Cleveland Dallas Detroit Kansas City Milwaukee Minneapolis New York Oakland Seattle Toronto
The second file, file2, contains this sorted list:
Atlanta Chicago Cincinnati Houston Los Angeles Montreal New York Philadelphia Pittsburgh San Diego San Francisco St. Louis
To display the lines unique to each file and common to the two files, enter: comm file1 file2
This command results in the following output: Anaheim Atlanta Baltimore Boston Chicago Cincinnati Cleveland Dal-
las Detroit Houston Kansas City Los Angeles Milwaukee Minneapolis Montreal New York Oakland Philadel-
phia Pittsburgh San Diego San Francisco Seattle St. Louis Toronto
The leftmost column contains lines in file1 only, the middle column contains lines in file2 only, and the rightmost column contains
lines common to both files. To display any one or two of the three output columns, include the appropriate flags to suppress the
columns you do not want. For example, the following command displays columns 1 and 2 only: comm -3 file1 file2
Anaheim
Atlanta Baltimore Boston
Cincinnati Cleveland Dallas Detroit
Houston Kansas City
Los Angeles Milwaukee Minneapolis
Montreal Oakland
Philadelphia
Pittsburgh
San Diego
San Francisco Seattle
St. Louis Toronto
The following command displays output from only the second column: comm -13 file1 file2
Atlanta Cincinnati Houston Los Angeles Montreal Philadelphia Pittsburgh San Diego San Francisco St. Louis
The following command displays output from only the third column: comm -12 file1 file2
Chicago New York
SEE ALSO
Commands: cmp(1), diff(1), sdiff(1), sort(1), uniq(1)comm(1)