Just out of curiosity, you can use shell constructs for this, too.
ksh could use print instead of printf; tested with bash. (Using echo is not very robust, but would be compatible even with the earliest Bourne shells. But then, local is a fairly recent addition, isn't it?)
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)
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)
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)
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)
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)
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)
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)
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)
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)