10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Just saw a "sed" format to reverse display the file contents, but am not geting its logic completely. I would appreciate if somebody can explain
sed '1!G;h;$!d' < filename
All I know in this is that :
G will add a new line after every line except first one... (5 Replies)
Discussion started by: dextergenious
5 Replies
2. Shell Programming and Scripting
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
Discussion started by: vivek d r
2 Replies
3. Shell Programming and Scripting
Hi,
I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file.
i am able to... (2 Replies)
Discussion started by: seeki
2 Replies
4. Shell Programming and Scripting
Hi,
I want to delete the contents of a file which are matching with contents of other file in shell scripting.
Ex.
file1
sheel,sumit,1,2,3,4,5,6,7,8
sumit,rana,2,3,4,5,6,7,8,9
grade,pass,2,3,4,5,6,232,1,1
name,sur,33,1,4,12,3,5,6,8
sheel,pass,2,3,4,5,6,232,1,1
File2... (3 Replies)
Discussion started by: ranasheel2000
3 Replies
5. UNIX for Dummies Questions & Answers
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Discussion started by: krishnampkkm
5 Replies
6. Shell Programming and Scripting
Hi all
I am trying to numerically reverse sort a file but I seem to be having trouble.
Example of file contents:
text1,1
text2,-1
text3,0
I can sort using sort -k 2n -t, filename without any problems.
However I want my results in descending order but using -r in my command... (2 Replies)
Discussion started by: pxy2d1
2 Replies
7. UNIX for Dummies Questions & Answers
Hi Guys,
I am a newbie to Unix. I am having a requirement. I am having a file whose contents are mentioned below:
S.no EmployeeName EmployeeID
1. MAHESH 01
2. SHANKAR 02
3. SATHEESH 03
4. RANJITH 04
5. SYED ... (1 Reply)
Discussion started by: mraghunandanan
1 Replies
8. Shell Programming and Scripting
i am using AIX -ksh
how can i reverse any file ,i have already try tac cmd it is not in AIX:
please help me out. (3 Replies)
Discussion started by: RahulJoshi
3 Replies
9. UNIX for Dummies Questions & Answers
I've got hundreds of lines in a file that looks like this:
Line1 CCR CCH
Line2 ICVM FBO GSC
Line3 MKF
The result should be like the one below so that I can insert them on our database.
Line1 CCR
Line1 CCH
Line2 ICVM
Line2 FBO
Line2 GSC
Line3 MKF
Thanks in advance! (4 Replies)
Discussion started by: The One
4 Replies
10. Shell Programming and Scripting
Hi,
I am not sure how to start doing this so I hope to get some advice as to how to start.
I have 2 files. The source file contains data that I needed is in columns delimited by ";". For example, in this format:
"CONTINENT","COUNTRY","CITY","ID"
"asia","japan","tokyo","123"... (21 Replies)
Discussion started by: ReV
21 Replies