10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
i am trying to print required multiple columns dynamically from a fie.
But i am able to print only one column at a time.
i am new to shell script, please help me on this issue.
i am using below script
awk -v COLT=$1 '
NR==1 {
for (i=1; i<=NF; i++) {
... (2 Replies)
Discussion started by: balu1234
2 Replies
2. UNIX for Beginners Questions & Answers
Hi,
I have a backup report that unfortunately has some kind of hanging indent thing where the first line contains one column more than the others
I managed to get the output that I wanted using awk, but just wanting to know if there is short way of doing it using the same awk
Below is what... (2 Replies)
Discussion started by: newbie_01
2 Replies
3. Shell Programming and Scripting
set -x
for file in /Src/MEDIA_ASSET/*.csv;
do
Header_Format = 'VariantNumber|ERP_SYSTEM_CD|MediaType'
FILESTATUS = GOOD
File_Header = $(cut -d'|' -f1-3 ${file}|head -1)
do
if ;
then
${FILESTATUS} = GOOD
else
${FILESTATUS} = BAD
break
fi
done
... (3 Replies)
Discussion started by: spidy
3 Replies
4. UNIX for Beginners Questions & Answers
I have this code below that only prints out certain columns from the first two rows (doesn't affect rows 3 and beyond). How can I do the same on a partial header pattern “G_TP” instead of having to know specific column numbers (e.g. 374-479)? I've tried many other commands within this pipe with no... (4 Replies)
Discussion started by: aachave1
4 Replies
5. Emergency UNIX and Linux Support
Hi Friends,
I have files with columns like this. This sample input below is partial.
Please check below for main file link. Each file will have only two rows.
... (8 Replies)
Discussion started by: jacobs.smith
8 Replies
6. Shell Programming and Scripting
Hi to all,
I have two files. File1 has no header, two columns:
sample1 A
sample2 B
sample3 B
sample4 C
sample5 A
sample6 D
sample7 D
File2 has a header, except for the first 3 columns (chr,start,end). "sample1" is the header for the 4th ,5th ,6th columns, "sample2" is the header... (4 Replies)
Discussion started by: aec
4 Replies
7. Shell Programming and Scripting
Hi Friends,
I have a file1
i want to retrieve only the fields which have DEP,CITY,TRANS as headers in other file.
Output:
I want to give the input as DEP,CITY,TRANS column names to get the output.
i used cut command .. but if i have 300 fileds it is more difficult to... (4 Replies)
Discussion started by: i150371485
4 Replies
8. Shell Programming and Scripting
awk experts,
I have a big file of 4000 columns with header. Would like to print the columns with string value of "Commands" in header. File has "," separator. This file is on ESX host with Bash.
Thanks,
Arv (21 Replies)
Discussion started by: arv_cds
21 Replies
9. Shell Programming and Scripting
Hi,
I'm having trouble pulling out columns where the headers match a file of key ID's I'm interested in and was looking for some help.
file1.txt
I
Name
34
56
84
350
790
1215
1919
7606
9420
file2.txt
I Name 1 1 2 2 3 3 ... 34 34... 56 56... 84 84... 350 350...
M 1 A A A A... (20 Replies)
Discussion started by: flotsam
20 Replies
10. Shell Programming and Scripting
Hi,
I have a file with multiple tab delimited columns and I would like to have the average of each column:
Iteration Tree No Lh HMean
1000 1 -78.834717 -78.834717
1100 1 -77.991031 -78.624046
1200 1 -79.416055 -78.761861
1300 1 -79.280494 -78.968099
1400 1 -82.846275 -80.808696 ... (4 Replies)
Discussion started by: mikey11415
4 Replies