10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
For instance, my file contains the following content...
set -A array
set -A test
${array}=1
${array}=2
${array}=3
${test}="Boy"
${test}="Girl"
${test}="Dog"
x=0
while ;do
print "${array}" " " "${test}"
x=$((x+1)
done... (1 Reply)
Discussion started by: TestKing
1 Replies
2. UNIX for Beginners Questions & Answers
I'm trying to learn awk, but I've hit a roadblock with this problem. I have a hierarchy stored in a file with 3 columns:
id name parentID
4 D 2
2 B 1
3 C 1
1 A 5
I need to check if there are any values in column 3 that are not represented anywhere in column 1. I've tried this:
awk '{arr;}... (7 Replies)
Discussion started by: kaktus
7 Replies
3. Shell Programming and Scripting
Hi,
I have multiple files that each contain one column of strings:
File1:
123abc
456def
789ghi
File2:
123abc
456def
891jkl
File3:
234mno
123abc
456def
In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a tab delimited text file where some lines have the string "NA" in the second column. For these lines, I want to replace NA with the value in the first column, the symbol underscore followed by the value in the fourth column. How do I go about doing that? Thanks!
Input:
1 ... (3 Replies)
Discussion started by: evelibertine
3 Replies
5. Shell Programming and Scripting
Hello,
I have not been able to find what I'm looking for via searching the forum. I could use some help with an awk script or one-liner to solve this simple problem.
I have two files. If $1 and $2 from file1 match $1 and $2 from file2, print the whole line from file2.
Example file1
... (2 Replies)
Discussion started by: jm4smtddd
2 Replies
6. Shell Programming and Scripting
Hi,
I have a file (sample.txt) this file contains below text.
./au
./11.5.0
./11.5.0/admin
./11.5.0/admin/driver
./po
./11.5.0
./11.5.0/admin
./11.5.0/admin/driver
./xxsbx/11.5.0/java/src
./xxsbx/11.5.0/lib
./xxsel
./xxsel/11.5.0
./xxsel/11.5.0/admin
./zfa
./zfa/11.5.0... (2 Replies)
Discussion started by: gagan4599
2 Replies
7. Shell Programming and Scripting
Hi,
I am trying to send output from a shell scrip to a txt file in a colum format. I have all I can and I dont seem to understand why the results from one one particular file keeps going to the next line. How can I force all to be in one line
Please see code and output below
The is... (0 Replies)
Discussion started by: asemota
0 Replies
8. Shell Programming and Scripting
Does anybody understand why this is not being interpreted as true.
Script:
#!/bin/bash
errored=`grep "errored" new_update_scripts.txt`
echo $errored = "errored"
if ; then
echo true
else
echo false
fi
Output:
$ UpdateScripts
errored = errored
false (7 Replies)
Discussion started by: scottwmackey
7 Replies
9. Shell Programming and Scripting
Hi guys,
I need some help to come out with a solution . I have seven such files but I am showing only three for convenience.
filea
a5 20
a8 16
fileb
a3 42
a7 14
filec
a5 23
a3 07
The output file shoud contain the data in table form showing first field of... (7 Replies)
Discussion started by: smriti_shridhar
7 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have a file containing the following data:
junk123junk723itemcode001qty01price10total10junkjunk
junk123junk723itemcode002qty02price10total20junkjunk
..
..
..
could be 5000+ lines
I have an algo and need a code to implement this:
1. Linecount = wc -l (should give 5000)
2. For i... (1 Reply)
Discussion started by: shiroh_1982
1 Replies