10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to add a comma at the end of each line in this file?30 1412
30 3352
30 5254
30 5543
30 7478
3 28
3 30
3 39
3 54
3 108
3 152
3 178
3 182
3 214
3 271
3 286
3 300
3 348
3 349
3 371 (3 Replies)
Discussion started by: gunjan
3 Replies
2. Shell Programming and Scripting
Given a file like this:
abc
def
ghi
I need to get to
somestandardtext abc1 morestandardtext
somestandardtext def2 morestandardtext
somestandardtext ghi3 morestandardtext
Notice that in addition to the standard text there is the line number added in as well. What I conceived is... (4 Replies)
Discussion started by: edstevens
4 Replies
3. Shell Programming and Scripting
Does anyone know how to use awk to act like grep from a particular line number to the end of file? I am using Solaris 10 and I don't have any GNU products installed.
Say I want to print all occurrences of red starting at line 3 to the end of file.
EXAMPLE FILE:
red
green
red
red... (1 Reply)
Discussion started by: thibodc
1 Replies
4. Shell Programming and Scripting
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies
5. Shell Programming and Scripting
hi,
i have file which is having large sql query
eg :
i am executing this sql file but now i want to add ; after query on same line
i.e. i should look like
any idea how to achieve it ? (6 Replies)
Discussion started by: crackthehit007
6 Replies
6. Shell Programming and Scripting
Hello, Would someone guide me on how to write a shell script the would search for a phone no using at the end text file using sed or awk and store it in a varaible or print it.
The text file is in this form
text or numbers in first line
text or numbers in second line
.
.
.
Firsname... (6 Replies)
Discussion started by: amuthiga
6 Replies
7. UNIX for Advanced & Expert Users
Hi i would like to add line numbers to end of each line in a file.
I am able to do it in the front of each line using sed, but not able to add at the end of the file.
Can anyone suggest
The following code adds line number to start of each line
sed = filename | sed 'N;s/\n/\t/'
how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies
8. Shell Programming and Scripting
Hi All
I have a script which has produced a list, I have used 'sed' to number my list, but i want to list at end of line with the first line starting at zero (0) and brackets round it
ie
My List i want
Hello (0)
this (1)
day (2)
can (3)
be (4)
sed '/./=' filename | sed '/./N; s/\n/) /'... (5 Replies)
Discussion started by: chassis
5 Replies
9. Shell Programming and Scripting
Hi,
Does anyone know if its possible to add something like an end of line like c or java in unix?
dirs=/home/nosnam
var=''
for dir in $dirs
do
listDirs=`ls -d1 $dir/*`
for eachList in $listDirs
do
listRepos=`du -ks $eachList | awk '{ x+=$1 }; END { print x... (4 Replies)
Discussion started by: nosnam
4 Replies
10. Shell Programming and Scripting
Hi Guys/Gals,
I have a log file that is updated once every few seconds and I am looking for a way to speed up one of my scripts.
Basically what I am trying to do is grep through a text file from start to finish once. Then each subsequent grep starts at the last line of the previous grep to... (4 Replies)
Discussion started by: Jerrad
4 Replies