10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Good day all.
Using basic UNIX/Linux tools, how would you delete a line based on a character found in column 1?
For example, if the CITY name contains an 'a' or 'A', delete the line:
New York City; New York
Los Angeles; California
Chicago; Illinois
Houston; Texas
Philadelphia;... (3 Replies)
Discussion started by: BRH
3 Replies
2. Shell Programming and Scripting
I have the following awk script set up to copy the contents of a line that contains 0008 in each line that contains values of 1895 through 2012.
awk -v OFS=" " '{val=0+substr($1,length($1)-3,4);if(val==0008){print;$1=x;y=$0}else{if(val>=1895&&val<=2012){print $1 y}else{print}}}'
Output... (7 Replies)
Discussion started by: ncwxpanther
7 Replies
3. Shell Programming and Scripting
Hi
I have 2 files
1.del
----
1,2,3,4,5
1,2,3,4,4
1,1,1,1,2
2.del
----
1,2,3,4,5
1,
1,2,3,4,4
1,1,1,1,2
I need to compare the above two files in unix, as in the output should only tell the difference in contents as I should get only the line
1 ( from 2.del) , rest all lines are... (4 Replies)
Discussion started by: Ethen561
4 Replies
4. Shell Programming and Scripting
Dear all,
I have many files(.csv) in a directory.
I want to concatenate the files which have similar entries in a particular column and save into a new file like result_datetime.csv etc.
One example file is like below.
Sno,Step,Data1,Data2,Data3 etc.
1,0,2,3,4
2,1,3,4,5
3,2,0,1,1
... (4 Replies)
Discussion started by: ks_reddy
4 Replies
5. Shell Programming and Scripting
I am trying to update an older program on a small cluster. It uses individual files to send jobs to each node. However the newer database comes as one large file, containing over 10,000 records. I therefore need to split this file. It looks like this:
HMMER3/b
NAME 1-cysPrx_C
ACC ... (2 Replies)
Discussion started by: fozrun
2 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have two files as shown below:
test1
678
679
689
690
710
test2
1 678
654 800
676 791
689 900
I want to get a count of lines from test2 whose columns bound the values in test1
I tried running the code below; however am getting wrong results. (3 Replies)
Discussion started by: Gussifinknottle
3 Replies
7. Shell Programming and Scripting
I have a spreadsheet in a folder that looks like this:
Sector1...Sector2...Sector3...Sector4...Sector5...Sector6...Sector7
SomeID....Title.......SomeID...SomeID....SomeID...SomeID....SomeID
OtherID...MyTitle....SomeID...SomeID....SomeID...SomeID....SomeID... (7 Replies)
Discussion started by: Xterra
7 Replies
8. Shell Programming and Scripting
Hello everyone, my first post here, please feel free to inform me if my question can be better formatted so my future posts may be more clear.
I have a large text file which I need parsed in one specific way, I have done the rest of the processing, I am simply lacking the last aspect of such.
... (8 Replies)
Discussion started by: ryanfx
8 Replies
9. Shell Programming and Scripting
Hi,
I have a file f1 having the contents as below
select (<condn>) from dual
I have another file f2 having the contents as below
1,
2,
3
I want to replace <condn> in f1 with the contents of f2
I tried using sed like this
sed "s:<condn>:`cat f2`:g" f1
The above command resulted in sed:... (3 Replies)
Discussion started by: mr_manii
3 Replies
10. Shell Programming and Scripting
So, this issue is driving me nuts! I was hoping to get a lending hand here...
I have 2 files:
file1.txt contains:
this is example1
this is example2
this is example3
this is example4
this is example5
file2.txt contains:
example3
example5
Basically, I need a script or command to... (4 Replies)
Discussion started by: bashshadow1979
4 Replies